Sleep and hibernate command line

Page 2 of 2 FirstFirst 12
  1. Kari's Avatar
    Posts : 17,434
    Windows 10 Pro
       #11

    SLENDER RISING said:
    Then, you can just type in any cmd mode
    Code:
    shutdown/h /t 0
    for it to hibernate instantly or, otherwise,
    Code:
    shutdown/h
    for it to set a hibernate mode within 30 seconds of the command being introduced.
    ...
    ...
    Edit its route from "C:\Windows\System32\shutdown.exe" to "C:\Windows\System32\shutdown.exe /h /t 0" for instant hibernate, or "C:\Windows\System32\shutdown.exe /h" for 30 second delay before hibernate.
    Just to clarify this: Hibernate switch (/h) used with shutdown command does not accept time delay switch (/t X where X is delay in seconds). Command shutdown /h /t 0 does therefore not work. Time delay switch can only be used with restart (/r) and shut down (/s) switches

    The only correct way to hibernate with shutdown is shutdown /h without any additional parameters.

    Kari
      My Computer

  2. SLENDER RISING's Avatar
    Posts : 10
    Windows 10
       #12

    Pipppero2007 said:
    About shutdowb /h i see around other ways to hibernate so i can be sure it will only go to hibernate my pc without touching else?
    Worry not about this, I have had it enabled since 2015 and not a single problem with other files or system configuration
    As for the sleep command, I disacknowledge completely on the topic
      My Computer

  3. SLENDER RISING's Avatar
    Posts : 10
    Windows 10
       #13

    Kari said:
    Just to clarify this: Hibernate switch (/h) used with shutdown command does not accept time delay switch (/t X where X is delay in seconds). Command shutdown /h /t 0 does therefore not work. Time delay switch can only be used with restart (/r) and shut down (/s) switches

    The only correct way to hibernate with shutdown is shutdown /h without any additional parameters.

    Kari
    I must truly be thankful for the correction, sire, explains why in other computers it hasn't worked lately. I mean, haven't used the command by itself for almost 2 years now ¯\_(シ)_/¯ people tend to forget
      My Computer


  4. Posts : 187
    Windows 10 Pro 64 bit
    Thread Starter
       #14

    Everything works, i only need to test pstools for suspend.
    Its weird its a tool fron 2006...
    Also dont understand what eula does, why somebody add -accepteula in the command line and if this pstool is a service or just an exe.
    Hope to test tomorrow.
      My Computer

  5. AndreTen's Avatar
    Posts : 23,332
    Windows 10 (Pro and Insider Pro)
       #15

    Pipppero2007 said:
    Everything works, i only need to test pstools for suspend.
    Its weird its a tool fron 2006...
    Also dont understand what eula does, why somebody add -accepteula in the command line and if this pstool is a service or just an exe.
    Hope to test tomorrow.
    Eula is usually referred to as an End User Licence Agreement. Looks like you have to agree to pstools EULA if you use it... If you want to use it in command line, you have agree with the terms in that way...

    from Wikipedia:

    In proprietary software, an end-user license agreement or software license agreement is the contract between the licensor and purchaser, establishing the purchaser's right to use the software.
    I'll look around, if there is another way to do that.
      My Computers

  6. AlainCh2's Avatar
    Posts : 50
    W10
       #16

    I can tell Sleep 'cause I'm using it for several years in a shortcut in >W10:
    Code:
    %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState Standby
    What I'm looking for, is the same ability to come back only touching the mouse.

    I'm not sure it works for hibernate as somebody suggested it in another post:
    Code:
    %windir%\System32\rundll32.exe powrprof.dll,SetSuspendState
    But I'll give that a try and report back

    Alain

    Edit:
    I confirm that it work perfectly also for Hibernation,
    Last edited by AlainCh2; 02 Jan 2019 at 01:01.
      My Computers

  7. Try3's Avatar
    Posts : 7,461
    Windows 10 Home x64 Version 20H2 Build 19042.928
       #17

    I use a command that works for sleep even though hibernate is enabled.
    - You are trying to do so using [MS SysInternals] PSTools.
    - I do so using NirSoft's NirCmd utility.

    My command line is written into a shortcut. I've left in my own full path but you would want to substitute your own.
    Code:
    C:\Tools\External\NirSoft\NirCmd\x64\NirCmd.exe standby

    Denis
      My Computer


 
Page 2 of 2 FirstFirst 12

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 16:37.
Find Us




Windows 10 Forums