1

I have a laptop back home with Windows Vista installed.

I want my computer to fall asleep automatically at 01:30 AM and wake up at 06:30 AM.

I have tried a lot, but making a .bat file which makes it fall asleep needs to be manually activated. How can I do it automatically?

Pylsa
  • 31,383

4 Answers4

1

Check if there is an support in the bios for automatic wake up/shut down.

xciter
  • 524
  • 2
  • 7
1

Try Task Scheduler, built into the OS. It can, appropriately, schedule tasks to run at specific times, in response to events, and give you a decent amount of control over when these tasks repeat.

You can tell it to run just about anything, so batch files can be your friend: Though for waking up scheduled tasks won't do, as it can't run. You may be able to use wake-on-LAN, or your BIOS may be able to wake your PC at a specific time.

Phoshi
  • 23,483
1

There's an entire SU question regarding shutting down/sleeping the computer from the command-line, so I won't bother repeating that info here again:

How can I put the computer to sleep from Command Prompt/Run menu?

For waking the computer:

Unlike what @Phoshi seems to suggest in his answer (from 2011), with Vista+ you can use Task Scheduler to wake up the computer from sleep.

Look under the Conditions Tab for your task:

enter image description here

Basically create a task, set the time you want to wake the computer, and then set it to run a program, with the "Wake the computer to run this task" enabled. For example, running cmd.exe with /c exit as the arguments will cause the CMD to be launched, and then exit is immediately run to close the CMD window.

More info: How to Make Your PC Wake From Sleep Automatically

0

For Statup, there should be a setting in the BIOS, but without more details can't really help.


  1. You'll need a batch file, scheduled to run at 1:30am. Copy and paste this into a txt file, save it to a location where it won't get deleted (C:\Windows) as die.bat (NOT die.bat.txt)

shutdown /s /f /t 20

  1. This shuts the computer down (/s), forces any process to end (/f) with a 20 seconds timeout (/t 20). To make it sleep/hibernate, use the /h flag instead of the /s one.

  2. Next, click on start and find Task Schedular. (All Programs, Accessories, Systems Tools, Task Scheduler).

  3. On the right-hand pane, click "Create Basic Task" enter image description here

  4. Give the task a name and description (example "Shutdown").

  5. Choose when you want to task to run (example "Daily")

  6. Choose what time you want to the task to run (example "01:30:00), recur ever 1 days)

  7. Choose "Start a Program"

  8. Browse to the location of the .bat file.

  9. Click Next, Click Finish.

  10. To test, save all your work, right-click, and "Run Now".

tombull89
  • 6,699