A script to Force the shutdown of a computer or computers on a network
If you wish to shut down a computer or all of the computers overnight on a network at a certain time there is a simple batch file you can write to do this. First i will show you the code then explain what each section means to allow you to manipulate it to work with your network. The code will need to be put in notepad and saved as a .bat file to allow it to run.
shutdown -s -m \\<computer name> -t 300 -c "This PC will shutdown for the night in 5 minutes. Please save your work and log off now. Thanks.." -f
The green highlighted areas are the items you adapt to make the code your own. Each item is described below
The Code Explained
Firstly the comand is shutdown, using this command you can shutdown or restart the computer.. The -S refers to the shutdown as apposed to restart. The -m \\ <computer name> this is where you put the name of the computer you wish to shutdown. So if its call OfficeComputer this section would read -m \\Oficecomputer . The -T refers to the amont of time in seconds before the computer will shut down. Then you can add a description that will appear in a popup on the computer before it shutsdown. This is included between the speach marks. The final option -F is used to force the shutdown of the computer if applications are open.
If you open up a notepad file you can copy and paste this line of code for every computer in the office, making sure you change the computer name on each line to represent each computer. Once you have done this you can add it to the scheduled tasks to run at a certain time.