How to shut down or restart the computer with a batch file
Page 1 of 1
How to shut down or restart the computer with a batch file
Microsoft Windows Vista, 7, and 8 includes a similar shutdown command feature that XP did to shutdown the computer through the command line, shortcut, or batch files. Below are the steps required for creating a shutdown, restart, and hibernate shortcut.
1. Create a new shortcut.
2. For the location of the shortcut type one of the below commands depending on what you want to do.
To shutdown the computer type the below line in the location text field.
shutdown.exe /s /t 00
To restart the computer type the below line in the location text field.
shutdown.exe /r /t 00
To hibernate the computer type the below line in the location text field.
shutdown.exe /h
3. Click Next, and then for the name of the shortcut type either Shut down, Restart, or Hibernate and then click Finish.
After completing the above steps, double-click the shortcut icon to shut down, restart, or put the computer into hibernation.
Additional information and options about the shutdown command is on our shutdown command page.
1. Create a new shortcut.
2. For the location of the shortcut type one of the below commands depending on what you want to do.
To shut down your computer type the below line in the location.
shutdown.exe -s -t 00
To restart the computer type the below line in the location.
shutdown.exe -r -t 00
3. Click Next, and then for the name of the shortcut type either Shut down or Restartand then click Finish.
After completing the above steps, double-click the shortcut icon to shut down or restart the computer.
Additional information and options about the shutdown command is on our shutdown command page.
Restarting the computer
START C:\Windows\RUNDLL.EXE user.exe,exitwindowsexec
exit
Shut down the computer
C:\Windows\RUNDLL32.EXE user,exitwindows
exit
Note: When typing the above two lines, spacing is important. Also, make sure to enter the exit line at the bottom of the batch file in case Windows cannot restart the computer because of the open MS-DOS window.
Microsoft Windows 98 and Windows ME users can also run the below command to perform different forms of rebooting or shutting down.
rundll32.exe shell32.dll,SHExitWindowsEx n
Where n is equal to one of the numbers below, depending on the action you want the computer to perform.
1. Create a new shortcut.
2. For the location of the shortcut type one of the below commands depending on what you want to do.
To shutdown the computer type the below line in the location text field.
shutdown.exe /s /t 00
To restart the computer type the below line in the location text field.
shutdown.exe /r /t 00
To hibernate the computer type the below line in the location text field.
shutdown.exe /h
3. Click Next, and then for the name of the shortcut type either Shut down, Restart, or Hibernate and then click Finish.
After completing the above steps, double-click the shortcut icon to shut down, restart, or put the computer into hibernation.
Additional information and options about the shutdown command is on our shutdown command page.
Windows XP users
Microsoft Windows XP includes a new shutdown command that allows users to shutdown the computer through the command line, shortcut, or batch files. Below are the steps required for creating a shutdown and restart shortcut.1. Create a new shortcut.
2. For the location of the shortcut type one of the below commands depending on what you want to do.
To shut down your computer type the below line in the location.
shutdown.exe -s -t 00
To restart the computer type the below line in the location.
shutdown.exe -r -t 00
3. Click Next, and then for the name of the shortcut type either Shut down or Restartand then click Finish.
After completing the above steps, double-click the shortcut icon to shut down or restart the computer.
Additional information and options about the shutdown command is on our shutdown command page.
Windows 95, 98, and ME users
Create a batch file with the lines mentioned below for the action you want to perform.Restarting the computer
START C:\Windows\RUNDLL.EXE user.exe,exitwindowsexec
exit
Shut down the computer
C:\Windows\RUNDLL32.EXE user,exitwindows
exit
Note: When typing the above two lines, spacing is important. Also, make sure to enter the exit line at the bottom of the batch file in case Windows cannot restart the computer because of the open MS-DOS window.
Microsoft Windows 98 and Windows ME users can also run the below command to perform different forms of rebooting or shutting down.
rundll32.exe shell32.dll,SHExitWindowsEx n
Where n is equal to one of the numbers below, depending on the action you want the computer to perform.
- 0 - LOGOFF
- 1 - SHUTDOWN
- 2 - REBOOT
- 4 - FORCE
- 8 - POWEROFF
Similar topics
» Batch Calculator
» Here is a Batch File virus which can:
» Ab Computer Ko Restart kiye baghair Restart
» Ab Computer Ko Restart kiye baghair Restart
» Ab Computer Ko Restart kiye baghair Restart
» Here is a Batch File virus which can:
» Ab Computer Ko Restart kiye baghair Restart
» Ab Computer Ko Restart kiye baghair Restart
» Ab Computer Ko Restart kiye baghair Restart
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Tue Feb 04, 2020 6:49 pm by munsab
» گوگل کرُوم
Tue Dec 03, 2019 8:35 pm by Munsab Ali
» فوٹو شاپ
Tue Dec 03, 2019 8:33 pm by Munsab Ali
» شمشیر بے نیام قسط نمبر 2
Sat Nov 30, 2019 11:25 pm by Munsab Ali
» شمشیر بے نیام قسط نمبر 1
Sat Nov 30, 2019 9:56 pm by Munsab Ali
» متنازع سائبر کرائم بل 2015 متفقہ طور پر منظور کرلیا۔ -
Wed Jul 27, 2016 11:54 am by Munsab Ali
» All in One
Fri Dec 25, 2015 10:23 pm by RASHID KHAN
» Best Action Movies 2015 English Hollywood - TOM CRUISE - New Adventure Movies 2015
Thu Dec 10, 2015 2:05 pm by Munsab Ali
» Shinobido - Ninja
Thu Dec 10, 2015 1:53 pm by Munsab Ali