How to automatically make my PC sleep and wake up?
Solution 1
For Statup, there should be a setting in the BIOS, but without more details can't really help.
- 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
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.
Next, click on start and find Task Schedular. (All Programs, Accessories, Systems Tools, Task Scheduler).
On the right-hand pane, click "Create Basic Task"
Give the task a name and description (example "Shutdown").
Choose when you want to task to run (example "Daily")
Choose what time you want to the task to run (example "01:30:00), recur ever 1 days)
Choose "Start a Program"
Browse to the location of the .bat file.
Click Next, Click Finish.
To test, save all your work, right-click, and "Run Now".
Solution 2
Check if there is an support in the bios for automatic wake up/shut down.
Solution 3
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:
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
Solution 4
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.
Related videos on Youtube
Christian J
Updated on September 18, 2022Comments
-
Christian J over 1 year
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?
-
Christian J almost 13 yearsNot quiet the answerd i was looking for, but thanks :)
-
xciter almost 13 yearsI have tried it and it works, however I am not sure if every laptop supports this.
-
Christian J almost 13 yearsMy bios dosen't support the Wake up / shut down option , but i was more looking for a Batch file or something like that,
-
Christian J almost 13 yearscan you help me with the task scheduler ? have treid a bit in it, but never understood it 100% ...
-
Christian J almost 13 yearscan you help me with the task scheduler ? have treid a bit in it, but never understood it 100% ..
-
xciter almost 13 yearsWrong answer but here is a link :) thespinningdonut.com/…
-
Christian J almost 13 yearsthe tricky part: i dont want it to shut down, i want it to fell a sleep :)
-
xciter almost 13 yearsThis one then: marksanborn.net/howto/auto-hibernate-your-computer
-
UNK almost 13 years@Christian; I'm on Win7, so it may be different on your end, but what I did was type
Task Scheduler
into the search bar, then hitCreate Basic Task
on the right hand side. From there it's all pretty straightforward, and I've never particularly delved into the more complex areas. -
Christian J almost 13 yearsThx @xciter , Do U think that i can bake it turn on a certain time ? :)
-
xciter almost 13 yearsWell if you have a wireless router running DD-WRT there is an option there to send wake up packets to the machine at a certain time. This is just an example. There are many ways of doing wake-on-lan. I don
t think it there is way for it to wake up on it
s own. -
Christian J almost 13 years@Phoshi; Okay, i made a task called "Turn on" at 06:30 am and one called "Turn off" at 01:30 am, so now it should be working now ? :)
-
Christian J almost 13 yearsso it would be enough just to make it open cmd.exe? :)
-
UNK almost 13 years@Christian; Well, as the PC is sleeping, the task won't actually occur, because there's no Task Scheduler service running to notice that it should occur - but the going to sleep should work. For waking up you'll need to either poke your BIOS or use another machine to sent a wake-on-LAN packet. Preferably the first, but not all BIOS' support it. Your router may also support WOL, so you should check that. The Tomato firmware does, DD-WRT probably does, not sure about others.
-
Christian J almost 13 yearsi just checked out my router, it doesent have WOL, but i hve treid something like this, (allready had a schedul that made the pc wake up from sleep, and an .bar file witch made it sleep after 20 hours, but needed to be manually opned) and that worked, so this should work :)
-
Daniel about 9 yearshow does this wake the computer?