Any command to sleep PC after x seconds?

Page 2 of 2 FirstFirst 12

  1. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #11

    Hello @Frank15,

    Frank15 said:
    Perfect, good to know. Hibernating is fine for me now anyway and this works like a charm. Thanks again.


    Please mark this thread as Solved.
      My Computer


  2. Posts : 18,044
    Win 10 Pro 64-bit v1909 - Build 18363 Custom ISO Install
       #12

    Hello @Frank15,

    Frank15 said:
    . . . when I choose option [9] User defined and enter 1 (meaning 1 minute) it doesn't work, should I use a different notation?

    This is what I get:
    >Enter an Option number: 9

    >Enter the Time in Minutes and press <Enter>: 1

    C:\Windows\System32>
    ..then it does nothing after 1 minute...

    Very strange, I have just tested it on mine and it works fine.
    Did you press <Enter>?
    Do OTHER Minutes work, like TWO for example?
    I will try and have a look at it over the next couple of days.
    I have Hibernate turned off, but that should NOT make a difference.
      My Computer


  3. Posts : 163
    Windows 10
    Thread Starter
       #13

    Another solution to hibernate after n seconds: ping -n 20 127.0.0.1 > NUL 2>&1 && shutdown /h /f and changing the -n 20 to whatever time in seconds you want
      My Computer


  4. Posts : 41
    windows 10 Home
       #14

    This is one I found and I have been using it for quite some time. If I'm up late and am using the computer it won't go into "sleep mode" until I stop using the computer for 10 minutes or so.

    addictivetips.com
      My Computers


  5. Posts : 16,949
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #15

    colinp said:
    This is one I found and I have been using it for quite some time. If I'm up late and am using the computer it won't go into "sleep mode" until I stop using the computer for 10 minutes or so.
    addictivetips.com
    Colin,

    I don't understand why you don't simply set that up in Power options.
    Settings, System, Power & sleep

    Denis
      My Computer


  6. Posts : 163
    Windows 10
    Thread Starter
       #16

    Here's another two


    Powershell:
    sleep 30 | shutdown /h /f
    ..Ctrl+C to cancel

    CMD:
    ping -n 20 127.0.0.1 > NUL 2>&1 && shutdown /h /f
    and changing the -n 20 to whatever time in seconds you want

    These are hibernating for me, not sleeping, probably because I haven't disabled hibernation
      My Computer


  7. Posts : 16,949
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #17

    Frank15 said:
    Any command to sleep PC after x seconds?
    For the benefit of anybody else reading this thread, I posted a solution in Frank's other thread
    Sleep shortcut - using NirCmd [post #3] - TenForums

    Denis
      My Computer


  8. Posts : 41
    windows 10 Home
       #18

    Try3 said:
    Colin,

    I don't understand why you don't simply set that up in Power options.
    Settings, System, Power & sleep

    Denis
    Apparently, I misunderstood "So that, for example, I'm running some task that prevents the PC from going to sleep and then I go to bed, so I want my PC to sleep after 30 minutes."

    I thought he meant having the computer go into sleep mode on a schedule at night for instance. My mistake.
      My Computers


  9. Posts : 16,949
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #19

    colinp said:
    Apparently, I misunderstood ...
    Colin,

    I've done the same more times than I care to remember.

    All the best,
    Denis
      My Computer


 

  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 23:29.
Find Us




Windows 10 Forums