How do you automate "shut down?"

crantang

Senior member
Mar 7, 2001
374
0
0
In Windows98, there's a task scheduler, but I don't know how to use it to shut down my computer at a set time. Is there some sort of utility I can download to automate this? Thanks in advance!

 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Figure out what the command line shutdown command is, write a batch file, and setup the system to run that batchfile at a certain time. But running your system 24/7 (while helping Team Anandtech in one of its wonderful Distributed Computing projects) would be a much easier solution. And some people think leaving your system on is better for the hardware :)
 

AndyHui

Administrator Emeritus<br>Elite Member<br>AT FAQ M
Oct 9, 1999
13,141
17
81
Create a text file called shutdown.vbs

Put the following as the contents of the file:

set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "^{ESC}us{ENTER}"


Save the file and place it on the desktop or in the Quicklaunch or whatever, and then call it to run from Task Scheduler. It should shutdown Win when you double click it, or when it is run automatically by the scheduler.
 

crantang

Senior member
Mar 7, 2001
374
0
0
Andy, that was so awesome. Thanks a lot! Where do you learn things like this? It worked! Thanks again!
 

Barnaby W. Füi

Elite Member
Aug 14, 2001
12,343
0
0


<< Figure out what the command line shutdown command is, write a batch file, and setup the system to run that batchfile at a certain time. But running your system 24/7 (while helping Team Anandtech in one of its wonderful Distributed Computing projects) would be a much easier solution. And some people think leaving your system on is better for the hardware :) >>


surprisingly, or rather not surprisingly, there is no simple command for shutting down windows via the cli and/or a batch file.

rolleye.gif
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0


<<

<< Figure out what the command line shutdown command is, write a batch file, and setup the system to run that batchfile at a certain time. But running your system 24/7 (while helping Team Anandtech in one of its wonderful Distributed Computing projects) would be a much easier solution. And some people think leaving your system on is better for the hardware :) >>


surprisingly, or rather not surprisingly, there is no simple command for shutting down windows via the cli and/or a batch file.

rolleye.gif
>>



There was a way to do it via command line without vbs in win9x. I remember loading a batch file into startup at work one time...
 

AndyHui

Administrator Emeritus<br>Elite Member<br>AT FAQ M
Oct 9, 1999
13,141
17
81
There is a command line to do it involving RUNDLL32.EXE.

The problem is that I can not remember what the whole command was.
 

AndyHui

Administrator Emeritus<br>Elite Member<br>AT FAQ M
Oct 9, 1999
13,141
17
81
Yep...that's it.

The problem is that the RUNDLL32.EXE command only works with Win9x and not Win2K/WinXP.

I see that they offer something to download for WinXP, but you can also use a script (like my one above) to shutdown Win2K/WinXP natively.
 

btvillarin

Senior member
Nov 3, 2001
469
0
0
Yeah, I downloaded the file (very tiny), and copied it to my other HD/partition, and made a shortcut with the extensions suggested. It works just fine, without creating any vbs file. But, either way...