Home Windows Shutdown / Restart computer remotely - batch file script
Shutdown / Restart computer remotely - batch file script PDF Print E-mail
Written by Siva   
Sunday, 31 October 2010 01:46

 

    shutdown /? to see the list of switches.

     

     

    Here are a couple of the most command switches and what actions they peform:

    -l: Logs off the computer

    -s: Shuts down the computer

    -r: Restarts the computer

    -m \\computername: remote shutdown of a computer

    -f: Forces programs to close immediately

     

     

  1. To shut down the local computer in two minutes and display a "The computer is shutting down" message, use the following line in a batch file or type it at a command prompt, and then press ENTER:
  2.  

  3. shutdown /l /t:120 "The computer is shutting down" /y /c
  4.  

  5. To cancel the shutdown process, type the following line at the command prompt, and then press ENTER:
    shutdown /l /a /y
  6.  

  7. To shut down and restart a remote computer named "Support," use the following line in a batch file or type it at a command prompt, and then press ENTER:
  8.  

  9. shutdown \\support /r
  10.  

  11. To schedule the local computer to shutdown and restart at 10:00 P.M., type the following line at a command prompt, and then press ENTER:
  12.  

  13. at 22:00 shutdown /l /r /y /c
  14.  

  15. To schedule the local computer to shutdown and restart at 6:00 P.M. every weekday, type the following line at a command prompt, and then press ENTER:
  16.  

  17. at 18:00 /every:M,T,W,Th,F shutdown /l /r /y /c
  18.  

    Remote Shutdown via Batch File

    Finally, you can create a batch file so that you can do all of this by just clicking on a file! Or you can even schedule the batch file to be run at specific intervals using Windows Scheduler.

    Just go to Notepad and type in the commands you would have typed into the command prompt:

     

    shutdown –m \\computername1 –r

    shutdown –m \\computername2 –r

    shutdown –m \\computername3 –r

     

    This will restart three computers in network. You would of course replace computername1 with the actual names of your computers. Then simple save the file with a .BAT file extension. You can put as many commands into the batch file as you like, so feel free to experiment!

     

 
 

Advertisement

Featured Links:
HREmail.com
Looking for job? Try HREmail.com
Want to have CMS based Websites?
Try siliconwebcreators.com to CMS based websites.
VM Solutions Inc
For best VM solutions..
Digital Procedure Inc.
Looking for Oracle /SAP /Weblogic Consulting services? visit digitalprocedure.com