• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(Batch) How to shutdown a computer using a batch file
#1
How to shutdown your computer using a batch file.


STEP ONE:

The shutdown command is used to make a computer turn off, reboot or log off.


STEP TWO:

To make a computer shutdown you type:

shutdown -s

[Image: 1yoo6f.jpg]


STEP THREE:

To make a computer log off you type:

shutdown -l

[Image: 34j7w21.jpg]


STEP FOUR:

To make a computer reboot you type:

shutdown -r

[Image: m9vdb9.jpg]


STEP FIVE:

To stop a computer from shutting down you type:

shutdown -a


[Image: 15i9gcg.jpg]


STEP SIX:

You may of noticed that the default time for these commands is 30 seconds, but you can change it.

To change the time from 30 seconds you type:

shutdown "what you want the computer to do" -t "ammount of time in seconds".

[Image: 119yyw6.jpg]

Where it says "what you want the computer to do" replace that with either -s, -l or -r.


STEP SEVEN:

To force a computer to shut down (Cannot be cancelled) you type:

shutdown "what you want the computer to do" -f


[Image: 2psi0s9.jpg]

The "-f" simply forces all running applications to close.

I hope this has helped.
  Reply


Messages In This Thread
(Batch) How to shutdown a computer using a batch file - by Mark - 22-05-2010, 10:49 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  (Batch) Useful batch commands Mark 10 31,650 13-02-2011, 02:42 PM
Last Post: Mark
  How to make a menu in batch (And start processes) Mark 3 10,585 13-07-2010, 02:34 AM
Last Post: Jamez247
  (Batch) Autostarting programs on login Mark 0 5,408 22-05-2010, 10:44 PM
Last Post: Mark
  (Batch) Hello world - Your first Batch program Mark 0 6,891 22-05-2010, 10:35 PM
Last Post: Mark

Forum Jump: