Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.os.windows-10 > #94561

Re: How to impede W10 from hibernating automatically?

From "Carlos E.R." <robin_listas@es.invalid>
Newsgroups alt.comp.os.windows-10
Subject Re: How to impede W10 from hibernating automatically?
Date 2019-07-14 14:27 +0200
Message-ID <smjrvf-ks6.ln1@Telcontar.valinor> (permalink)
References (1 earlier) <qgal7g$epr$1@dont-email.me> <pd5pvf-kr1.ln1@Telcontar.valinor> <qgd4f2$tgl$3@dont-email.me> <lekpvf-5uc.ln1@Telcontar.valinor> <qgd8l0$o5k$1@dont-email.me>

Show all headers | View raw


On 13/07/2019 20.41, Paul wrote:
> Carlos E.R. wrote:
>> On 13/07/2019 19.30, Paul wrote:
>>> Carlos E.R. wrote:
>>>> On 12/07/2019 20.57, Paul wrote:
>>>>> Carlos E.R. wrote:

...


>>>> Trying in the powershell, to see the output. Produces error 0x65b
>>>>
>>>>
>>>> PS C:\Users\Carlos> powercfg /hibernate off
>>>> powercfg : Unable to perform operation.  An unexpected error (0x65b)
>>>> has occurred:  Function failed during execution.

...

>>>    "That error code 0x65b occurs if you try to run the command as a
>>> standard user.
>>>
>>>     You must open a Command Prompt or Powershell as an administrator"
>>
>> Actually, I was logged in as the administrator. Maybe I have to
>> explicitly open the powershell as administrator.
>> [...]
>> Yes, it accepts the command. I will tell tomorrow if it worked ;-)

It did :-)


>> Why can not the program give a proper text message saying what the
>> problem is, instead of a f* number and a few lines of garbage?
>>
>> What would be the trick with a batch file (with this command) to make it
>> run as administrator, right click and then run as administrator?
>>
> 
> I would recommend you install a GUI program with click-able
> radio buttons for the operating mode you desire.

Suggestions? :-)

> 
> powercfg /h off   is the kind of command you use for a permanent
> fix, which would not be appropriate for a laptop really. It was
> only offered as an illustration. Something more "nuanced" is
> required to offer the proper degree of dynamic control.

I could have two batch files, one "on", another "off".


> 
> Perhaps psexec could be used. I only use this for one purpose,
> and haven't tried a wealth of options on it. Maybe you could
> craft a shortcut of some sort with it ?
> 
> https://docs.microsoft.com/en-us/sysinternals/downloads/psexec
> 
> For example:
> 
>    psexec64 -hsi cmd.exe

-s  Run the remote process in the System account.
-h  If the target system is Vista or higher, has the process run with the account's elevated token, if available.
-i  Run the program so that it interacts with the desktop of the specified session on the remote system. If no session is specified the process runs in the console session.

Ah. Like telnet or ssh to the desired user.

> 
> raises a Command Prompt window to SYSTEM authority.

I'll have a look later on.

> 
> Whatever you use, outside of Scheduled Tasks, is likely
> to present a UAC prompt when it needs the Impersonate
> privilege from the administrator group capability.

That's Ok.

> 
> *******
> 
> You can also have a play with this - "Runas" aka "Run As".
> 
> And a shortcut might have a place to specify the account used.
> 
> https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2012-r2-and-2012/cc771525%28v%3Dws.11%29
> 
> 
>    runas /user:<localmachinename>\administrator cmd

I can try that.

I tried this batch script:

echo off
runas /user:Carlos powercfg /hibernate off
pause


The admin in this machine has my name; "administrator" does not exist.

I get this response:



C:\Users\Carlos\Desktop>echo off
RUNAS USAGE:

RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ]
        /user:<UserName> program

RUNAS [ [/noprofile | /profile] [/env] [/savecred] ]
        /smartcard [/user:<UserName>] program

RUNAS /trustlevel:<TrustLevel> program

   /noprofile        specifies that the user's profile should not be loaded.
                     This causes the application to load more quickly, but
                     can cause some applications to malfunction.
   /profile          specifies that the user's profile should be loaded.
                     This is the default.
   /env              to use current environment instead of user's.
   /netonly          use if the credentials specified are for remote
                     access only.
   /savecred         to use credentials previously saved by the user.
   /smartcard        use if the credentials are to be supplied from a
                     smartcard.
   /user             <UserName> should be in form USER@DOMAIN or DOMAIN\USER
   /showtrustlevels  displays the trust levels that can be used as arguments
                     to /trustlevel.
   /trustlevel       <Level> should be one of levels enumerated
                     in /showtrustlevels.
   program         command line for EXE.  See below for examples

Examples:
> runas /noprofile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""

NOTE:  Enter user's password only when prompted.
NOTE:  /profile is not compatible with /netonly.
NOTE:  /savecred is not compatible with /smartcard.
Press any key to continue . . .



I tried also:

runas /user:Minas-Morgul\Carlos powercfg /hibernate off
runas /profile /user:Minas-Morgul\Carlos powercfg /hibernate off
runas /user:Minas-Morgul\administrator powercfg /hibernate off

all with the same result. It does not like the input, but it does not say why it does not like it or what part of it.

It finally worked with this line:

runas /user:Minas-Morgul\Carlos "powercfg /hibernate off"

which means that the programmer of the command has not bothered to do proper error handling and that he only accepts one command string as a single string (thus the ""). Ie, first he handles the options with "/", then a single entry string. If more, error out with no reason given.


Interestingly, it requests my password, even if the session user is already "Carlos". Enter does not work.


Well, I can live with this. Now I have both on and off scripts, and need to see if the "on" sets hibernate on again, watching for a few hours while I lunch and have siesta ;-)




-- 
Cheers, Carlos.
	

Back to alt.comp.os.windows-10 | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

How to impede W10 from hibernating automatically? "Carlos E.R." <robin_listas@es.invalid> - 2019-07-12 15:54 +0200
  Re: How to impede W10 from hibernating automatically? gazelle@shell.xmission.com (Kenny McCormack) - 2019-07-12 18:41 +0000
    Re: How to impede W10 from hibernating automatically? "Carlos E.R." <robin_listas@es.invalid> - 2019-07-13 16:15 +0200
      Curious? (Was: How to impede W10 from hibernating automatically?) gazelle@shell.xmission.com (Kenny McCormack) - 2019-07-13 15:09 +0000
        Re: Curious? (Was: How to impede W10 from hibernating automatically?) "Carlos E.R." <robin_listas@es.invalid> - 2019-07-13 17:39 +0200
  Re: How to impede W10 from hibernating automatically? Paul <nospam@needed.invalid> - 2019-07-12 14:57 -0400
    Re: How to impede W10 from hibernating automatically? "Carlos E.R." <robin_listas@es.invalid> - 2019-07-13 16:11 +0200
      Re: How to impede W10 from hibernating automatically? Paul <nospam@needed.invalid> - 2019-07-13 13:30 -0400
        Re: How to impede W10 from hibernating automatically? "Carlos E.R." <robin_listas@es.invalid> - 2019-07-13 20:28 +0200
          Re: How to impede W10 from hibernating automatically? Paul <nospam@needed.invalid> - 2019-07-13 14:41 -0400
            Re: How to impede W10 from hibernating automatically? "Carlos E.R." <robin_listas@es.invalid> - 2019-07-14 14:27 +0200
              Re: How to impede W10 from hibernating automatically? "Carlos E.R." <robin_listas@es.invalid> - 2019-07-15 01:47 +0200
                Re: How to impede W10 from hibernating automatically? "Carlos E.R." <robin_listas@es.invalid> - 2019-07-16 10:58 +0200
                Re: How to impede W10 from hibernating automatically? Paul <nospam@needed.invalid> - 2019-07-16 07:13 -0400
                Re: How to impede W10 from hibernating automatically? "Carlos E.R." <robin_listas@es.invalid> - 2019-07-16 14:20 +0200
                Have you replaced Windows File Explorer with XYplorer ? Jeff-Relf.Me  @. - 2019-07-16 14:33 -0700
                Re: Have you replaced Windows File Explorer with XYplorer ? Paul <nospam@needed.invalid> - 2019-07-16 18:00 -0400
                Have you replaced Windows File Explorer with XYplorer ? Jeff-Relf.Me  @. - 2019-07-16 16:25 -0700
                Re: How to impede W10 from hibernating automatically? Frank Slootweg <this@ddress.is.invalid> - 2019-07-19 15:33 +0000
          Re: How to impede W10 from hibernating automatically? The Man in the High Castle <nospaming@nospam.com> - 2019-07-13 20:53 +0200
  Re: How to impede W10 from hibernating automatically? MikeS <MikeS@fred.com> - 2019-07-12 21:09 +0100
    Re: How to impede W10 from hibernating automatically? "Carlos E.R." <robin_listas@es.invalid> - 2019-07-13 16:13 +0200
  Re: How to impede W10 from hibernating automatically? "wasbit" <wasbitREMOVE@hotmail.com> - 2019-07-13 10:13 +0100
    I want nothing ( except a global hotkey ) to wake my monitor. Jeff-Relf.Me  @. - 2019-07-13 04:47 -0700
      Re: I want nothing ( except a global hotkey ) to wake my monitor. Paul <nospam@needed.invalid> - 2019-07-13 08:26 -0400
        Re: I want nothing ( except a global hotkey ) to wake my monitor. "Mayayana" <mayayana@invalid.nospam> - 2019-07-13 08:30 -0400
        I want nothing ( except a global hotkey ) to wake my monitor. Jeff-Relf.Me  @. - 2019-07-13 07:33 -0700
          Re: I want nothing ( except a global hotkey ) to wake my monitor. "Carlos E.R." <robin_listas@es.invalid> - 2019-07-13 16:51 +0200
          Re: I want nothing ( except a global hotkey ) to wake my monitor. "Mayayana" <mayayana@invalid.nospam> - 2019-07-13 11:31 -0400
            Re: I want nothing ( except a global hotkey ) to wake my monitor. "Carlos E.R." <robin_listas@es.invalid> - 2019-07-13 17:42 +0200
              Re: I want nothing ( except a global hotkey ) to wake my monitor. "Mayayana" <mayayana@invalid.nospam> - 2019-07-13 13:01 -0400
                Re: I want nothing ( except a global hotkey ) to wake my monitor. "Carlos E.R." <robin_listas@es.invalid> - 2019-07-13 20:33 +0200
            A monitor that doesn't flash "No Video Input" ? Jeff-Relf.Me  @. - 2019-07-13 12:21 -0700
              Re: A monitor that doesn't flash "No Video Input" ? Paul <nospam@needed.invalid> - 2019-07-13 17:05 -0400
                A monitor that doesn't flash "No Video Input" ? Jeff-Relf.Me  @. - 2019-07-13 14:43 -0700
                Re: A monitor that doesn't flash "No Video Input" ? KenW                  <kenw@nono.net> - 2019-07-13 19:35 -0600
                Re: A monitor that doesn't flash "No Video Input" ? Roger Blake <rogblake@iname.invalid> - 2019-07-14 23:24 +0000
              Re: A monitor that doesn't flash "No Video Input" ? "Mayayana" <mayayana@invalid.nospam> - 2019-07-13 17:10 -0400
                My eyes don't like the surprise. Jeff-Relf.Me  @. - 2019-07-13 14:59 -0700
                Re: My eyes don't like the surprise. "Carlos E.R." <robin_listas@es.invalid> - 2019-07-14 03:49 +0200
                Your monitor goes from black[off] to gray[on] ? Jeff-Relf.Me  @. - 2019-07-14 06:49 -0700
                Re: Your monitor goes from black[off] to gray[on] ? nospam <nospam@nospam.invalid> - 2019-07-14 10:40 -0400
                Re: Your monitor goes from black[off] to gray[on] ? "Carlos E.R." <robin_listas@es.invalid> - 2019-07-14 20:39 +0200
                Re: Your monitor goes from black[off] to gray[on] ? "Carlos E.R." <robin_listas@es.invalid> - 2019-07-14 21:32 +0200
                15 seconds after the monitor is put to sleep. Jeff-Relf.Me  @. - 2019-07-14 13:24 -0700
                Re: 15 seconds after the monitor is put to sleep. Paul <nospam@needed.invalid> - 2019-07-14 16:57 -0400
                15 seconds after the monitor is put to sleep. Jeff-Relf.Me  @. - 2019-07-14 14:35 -0700
                Re: 15 seconds after the monitor is put to sleep. "Carlos E.R." <robin_listas@es.invalid> - 2019-07-15 01:53 +0200
                Re: 15 seconds after the monitor is put to sleep. Paul <nospam@needed.invalid> - 2019-07-14 17:46 -0400
                Is your monitor using VGA ? Jeff-Relf.Me  @. - 2019-07-14 15:28 -0700
                Re: Is your monitor using VGA ? Paul <nospam@needed.invalid> - 2019-07-14 18:52 -0400
                DisplayPort is funky. Jeff-Relf.Me  @. - 2019-07-14 16:32 -0700
                Re: DisplayPort is funky. Char Jackson <none@none.invalid> - 2019-07-14 18:38 -0500
                The boom is busting. Jeff-Relf.Me  @. - 2019-07-14 17:18 -0700
                Re: The boom is busting. Stench <stenchmate@floogie.org> - 2019-07-14 20:29 -0400
                Re: 15 seconds after the monitor is put to sleep. "Carlos E.R." <robin_listas@es.invalid> - 2019-07-15 01:49 +0200
                DisplayPort 1.4 or HDMI v2.0 is different ? Jeff-Relf.Me  @. - 2019-07-14 17:36 -0700
                Switching to a HDMI v2.0 cable should solve my "No Signal" problem. Jeff-Relf.Me  @. - 2019-07-14 18:33 -0700
                Re: Switching to a HDMI v2.0 cable should solve my "No Signal" problem. Char Jackson <none@none.invalid> - 2019-07-14 22:50 -0500
                Switching to a HDMI v2.0 cable should solve my "No Signal" problem. Jeff-Relf.Me  @. - 2019-07-14 21:29 -0700
                Seeing an advertisement, first thing in the morning. Jeff-Relf.Me  @. - 2019-07-14 12:36 -0700
                Re: My eyes don't like the surprise. owl <owl@rooftop.invalid> - 2019-07-14 15:02 +0000
                I don't want to be blinded by an advertisement, first thing. Jeff-Relf.Me  @. - 2019-07-14 09:06 -0700
                Re: I don't want to be blinded by an advertisement, first thing. owl <owl@rooftop.invalid> - 2019-07-14 16:12 +0000
                Re: I don't want to be blinded by an advertisement, first thing. Rene Lamontagne <rlamont@shaw.ca> - 2019-07-14 11:17 -0500
                I don't want to be blinded by an advertisement, first thing. Jeff-Relf.Me  @. - 2019-07-14 09:22 -0700
                Re: I don't want to be blinded by an advertisement, first thing. owl <owl@rooftop.invalid> - 2019-07-14 17:00 +0000
                I don't want to be blinded by an advertisement, first thing. Jeff-Relf.Me  @. - 2019-07-14 11:16 -0700
                Re: I don't want to be blinded by an advertisement, first thing. owl <owl@rooftop.invalid> - 2019-07-14 18:26 +0000
                I spent hours googling, looking for a better monitor. Jeff-Relf.Me  @. - 2019-07-14 12:07 -0700
                Re: I spent hours googling, looking for a better monitor. Kompressor  <Kompressor@local.com> - 2019-07-14 19:23 +0000
                Re: I spent hours googling, looking for a better monitor. Snit <usenet@gallopinginsanity.com> - 2019-07-14 12:42 -0700
                I spent hours googling, looking for a better monitor. Jeff-Relf.Me  @. - 2019-07-14 13:16 -0700
                Re: I spent hours googling, looking for a better monitor. Kompressor  <Kompressor@local.com> - 2019-07-14 20:19 +0000
                I spent hours googling, looking for a better monitor. Jeff-Relf.Me  @. - 2019-07-14 14:10 -0700
                Re: I spent hours googling, looking for a better monitor. Kompressor  <Kompressor@local.com> - 2019-07-14 21:15 +0000
                "wake the computer" is unchecked. Jeff-Relf.Me  @. - 2019-07-14 15:16 -0700
                Re: "wake the computer" is unchecked. Kompressor  <Kompressor@local.com> - 2019-07-14 22:21 +0000
                Different people, different problems. Jeff-Relf.Me  @. - 2019-07-14 16:09 -0700
                Re: Different people, different problems. Kompressor  <Kompressor@local.com> - 2019-07-14 23:16 +0000
                Who makes the best monitors, Taiwan, Korea or ShenZhen ? Jeff-Relf.Me  @. - 2019-07-14 17:01 -0700
                Re: "wake the computer" is unchecked. Snit <usenet@gallopinginsanity.com> - 2019-07-14 19:15 -0700
                Re: I spent hours googling, looking for a better monitor. Mandy Liefbowitz <mandyliefbowitz@the.port.side> - 2019-07-14 20:34 +0100
                100% "black" is bright gray. Jeff-Relf.Me  @. - 2019-07-14 13:44 -0700
                Re: I spent hours googling, looking for a better monitor. Melzzzzz <Melzzzzz@zzzzz.com> - 2019-07-14 20:29 +0000
                Do you also have sensitive eyes ? Jeff-Relf.Me  @. - 2019-07-14 14:14 -0700
                Re: Do you also have sensitive eyes ? Melzzzzz <Melzzzzz@zzzzz.com> - 2019-07-14 22:10 +0000
                Firefox v67, Developers Edition, Windows 10 v1903, Home Edition. Jeff-Relf.Me  @. - 2019-07-14 15:35 -0700
                Re: Do you also have sensitive eyes ? Siri Cruise <chine.bleu@yahoo.com> - 2019-07-14 16:58 -0700
                Re: I spent hours googling, looking for a better monitor. Frank Slootweg <this@ddress.is.invalid> - 2019-07-15 11:57 +0000
                I might have to upgrade my CPU+motherboard. Jeff-Relf.Me  @. - 2019-07-15 06:20 -0700
                Re: I might have to upgrade my CPU+motherboard. default <default@defaulter.net> - 2019-07-15 11:25 -0400
                Re: I might have to upgrade my CPU+motherboard. "Carlos E.R." <robin_listas@es.invalid> - 2019-07-16 11:10 +0200
                Re: I might have to upgrade my CPU+motherboard. default <default@defaulter.net> - 2019-07-16 05:26 -0400
                Re: I might have to upgrade my CPU+motherboard. "Carlos E.R." <robin_listas@es.invalid> - 2019-07-16 14:12 +0200
                My computer never sleeps. Jeff-Relf.Me  @. - 2019-07-16 06:04 -0700
                Re: I don't want to be blinded by an advertisement, first thing. Mandy Liefbowitz <mandyliefbowitz@the.port.side> - 2019-07-14 20:14 +0100
                I turn the brightness to zero, first thing, whenever I get a monitor. Jeff-Relf.Me  @. - 2019-07-14 13:05 -0700
                Re: I turn the brightness to zero, first thing, whenever I get a monitor. Char Jackson <none@none.invalid> - 2019-07-14 18:23 -0500
                Laying on your back is the only way to mouse. Jeff-Relf.Me  @. - 2019-07-14 17:07 -0700
                Re: Laying on your back is the only way to mouse. Char Jackson <none@none.invalid> - 2019-07-14 22:45 -0500
                Laying on your back is the only way to mouse. Jeff-Relf.Me  @. - 2019-07-14 21:16 -0700
                Re: I don't want to be blinded by an advertisement, first thing. Steve Carroll <"Steve Carroll"@noSPAM.none> - 2019-07-14 18:31 +0000
                Re: I don't want to be blinded by an advertisement, first thing. owl <owl@rooftop.invalid> - 2019-07-14 18:37 +0000
                Never do I look at my mouse, before I press a button. Jeff-Relf.Me  @. - 2019-07-14 12:29 -0700
                Re: I don't want to be blinded by an advertisement, first thing. Paul <nospam@needed.invalid> - 2019-07-14 14:34 -0400
                My Philips bdm4037uw has only one "button": a joystick/button. Jeff-Relf.Me  @. - 2019-07-14 15:52 -0700
                Re: My Philips bdm4037uw has only one "button": a joystick/button. Jim <gazwad45@nowherelocal.org> - 2019-07-14 19:05 -0400
                Collecting pocket lint. Jeff-Relf.Me  @. - 2019-07-14 16:44 -0700
                Re: I don't want to be blinded by an advertisement, first thing. Sam E <why.should.this@be.email.invalid> - 2019-07-15 10:32 -0500
                Re: My eyes don't like the surprise. John <Man@the.keyboard> - 2019-07-14 20:49 +0100
                I'm happy to answer calls 24/7. Jeff-Relf.Me  @. - 2019-07-14 14:06 -0700
    Re: How to impede W10 from hibernating automatically? "Carlos E.R." <robin_listas@es.invalid> - 2019-07-13 16:15 +0200

csiph-web