Link to home
Start Free TrialLog in
Avatar of JK2429
JK2429

asked on

shutdown using batch file.

How can I create a batch file/exe file which will shutdown my computer at a inputted time?
I would like have the computer shut down at an inputted time.
Is this even possible?  I am running XP Pro.

Thnx

JK
Avatar of gusdarino
gusdarino

Hi JK2429,

Try the freeware app: Shutdown Machine 1.0 at: http://www.slaw.com.au/pmp/

You can also download it from cnet.com

GusDarino
Avatar of Pete Long


Shutdown.exe is available in the Microsoft Windows 2000 Resource Kit. It is a command-line tool that you can use to shut down or restart a local or remote computer that is running Windows 2000 or Windows NT 4.0. or XP  If you want to schedule a computer to shut down and restart at a specific time, use Shutdown.exe in combination with the at command or Task Scheduler.


HOW TO: Use the Remote Shutdown Tool to Shut Down and Restart a Computer in Windows 2000
http://support.microsoft.com/default.aspx?scid=kb;en-us;317371

*****Software*****

PsShutdown is a command-line utility similar to the shutdown utility from the Windows 2000 Resource Kit, but with the ability to do much more. In addition to supporting the same options for shutting down or rebooting the local or a remote computer, PsShutdown can logoff the console user or lock the console (locking requires Windows 2000 or higher). PsShutdown requires no manual installation of client software.
http://www.sysinternals.com/ntw2k/freeware/psshutdown.shtml
Syntax: "psshutdown -u username -p password -r \\computername"

EMCO Remote Shutdown 1.4 is a Freeware utility to Shutdown/Reboot one or many machines on a NT network's. It works only under Administrator rights.
http://www.emco.is/remoteshutdown/rsdfeatures.html

Multi-Remote Shutdown Manager is an easy and fast way to shutdown the computers you administer
http://www.eytcheson.com/mrsm.htm

remote SHUTDOWN by Apteryx is a Windows Service that allows an administrator to logoff, shutdown* or reboot individual and/or grouped networked computers on demand from an easy to use interface. remote SHUTDOWN can also be used to route logoff, shutdown or reboot requests to individual or groups of other computers on the network also running remote SHUTDOWN
http://www.apteryxware.com/remoteshutdown/

FREEWARE
PowerOff
http://users.pandora.be/jbosman/applications.html
The new direct download link for poweroff 3.0 is:
http://users.pandora.be/jbosman/pwroff30.zip
Hi JK2429,

You could use Microsoft's "shutdown" command from the Win2000 resource kit.
Details can be found at http://support.microsoft.com/default.aspx?scid=kb;en-us;317371&sd=tech

You'd need a command like:
at 18:00 shutdown /l /y /c

Does that help?
Avatar of JK2429

ASKER

I have just been experimenting, if I use the command shutdown -s in the command prompt, I will  be able to shutdown in 30 seconds (like the blaster worm virus).  But I would like to execute a batch file which I would like to create on my computer to shutdown not in 30 seconds, but in the time I input.
ASKER CERTIFIED SOLUTION
Avatar of Steve McCarthy, MCSE, MCSA, MCP x8, Network+, i-Net+, A+, CIWA, CCNA, FDLE FCIC, HIPAA Security Officer
Steve McCarthy, MCSE, MCSA, MCP x8, Network+, i-Net+, A+, CIWA, CCNA, FDLE FCIC, HIPAA Security Officer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
This can be achieved by combining two commands that come natively with Win XP.... At and SHUTDOWN

Type  AT /?  and SHUTDOWN /? at a command prompt to get a quick review of the syntax for these commands.  Also, see these references for more in-depth explanations and examples.

   http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/at.mspx
   http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx

HTH,
Lynn
Avatar of JK2429

ASKER

Thank You!!
If you have IIS installed, you don't need to get any third-party or resource kit tools.  Just make a batch file with this one line:

iisreset /reboot

Use the task scheduler to schedule it however you want it.
use the shutdown -s command, but set it up in Windows Scheduled Tasks.  That way you can schedule what day and time / how often the task will occur.  Then use the -t argument just to set how many seconds warning time you'll have when it is shutting down.