Share via

Putting a computer to sleep on a timer using a batch file.

Anonymous
2020-11-14T02:56:32+00:00

As the subject says, I would love a .bat file that will put my computer to sleep in 2 hours, 72,000 seconds. Can someone help me out?

Windows for home | Windows 10 | Sleep and Power on, off

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

  1. Anonymous
    2020-11-14T20:52:22+00:00

    Hi Lovejoy89,

    Please, could you replace the line "timeout 72000 > NUL" (these are 20 hours) for the next below:

    @echo off

    echo %time%

    timeout /T 7200 && rundll32.exe powrprof.dll,SetSuspendState 0,1,0

    echo %time%

    I hope to operate fine now. Please, tell us the results.

    2 people found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2020-11-14T23:18:30+00:00

    Hi Lovejoy89,

    Please, could you replace the line "timeout 72000 > NUL" (these are 20 hours) for the next below:

    @echo off

    echo %time%

    timeout /T 7200 && rundll32.exe powrprof.dll,SetSuspendState 0,1,0

    echo %time%

    I hope to operate fine now. Please, tell us the results.

    That's what I was looking for, thank you so much!

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2020-11-14T18:51:23+00:00

    Hi Lovejoy89,

    I think that you can use the batch file with the next instructions, according to your description:

    @echo off

    echo %time%

    timeout 72000 > NUL

    echo %time%

    Note: If you use "timeout 72000" the system request confirm, with "> NUL" is automatic.

    I hope to help you. Please, tell us the results.

    It didn't do anything. Thank you for your attempt though!

    1 person found this answer helpful.
    0 comments No comments
  3. Anonymous
    2020-11-14T14:48:14+00:00

    Hi Lovejoy89,

    I think that you can use the batch file with the next instructions, according to your description:

    @echo off

    echo %time%

    timeout 72000 > NUL

    echo %time%

    Note: If you use "timeout 72000" the system request confirm, with "> NUL" is automatic.

    I hope to help you. Please, tell us the results.

    0 comments No comments
  4. Anonymous
    2020-11-14T03:17:32+00:00

    Hi Lovejoy89,

    I’m Mario an Independent Advisor. I’ll try to help with this problem.

    I have reviewed different information about your query and I think I found in the link below, complete information about the question, and also examples of how to do it considering all aspects, including the use of batch:

    I hope to help you. Please, tell us the results.

    0 comments No comments