To shutdown list of PC or servers on the network using command line or via batch file.
Copy and paste line below to notepad and save it as "ShutPC.bat".
FOR /F %%i IN (d:\PCList.txt) DO Shutdown /M \\%%i /S /F
Whatever list in "PCList.txt" will be shutdown.
To experiment on how the batch file will run or just to read the text file to make sure it will run automatically, do an 'echo' command.
FOR /F %%i IN (d:\PCList.txt) DO Echo "Shutdown /M \\%%i /S /F "
Shutdown a single server or PC:
Shutdown /M \\PC001 /S /F
Shutdown /M \\FileServer /S /F
/F - will force the server or PC to shutdown.
Run the batch file using a task scheduler so no need to monitor or execute the script manually.
PowerShell can also do powerful way of shutting down network computers, but old habits are hard to break..so command line still can do wonders and work best.
Automation is a lazy task for an smart IT administrator.
Cheers!!!
Copy and paste line below to notepad and save it as "ShutPC.bat".
FOR /F %%i IN (d:\PCList.txt) DO Shutdown /M \\%%i /S /F
Whatever list in "PCList.txt" will be shutdown.
To experiment on how the batch file will run or just to read the text file to make sure it will run automatically, do an 'echo' command.
FOR /F %%i IN (d:\PCList.txt) DO Echo "Shutdown /M \\%%i /S /F "
Shutdown a single server or PC:
Shutdown /M \\PC001 /S /F
Shutdown /M \\FileServer /S /F
/F - will force the server or PC to shutdown.
Run the batch file using a task scheduler so no need to monitor or execute the script manually.
PowerShell can also do powerful way of shutting down network computers, but old habits are hard to break..so command line still can do wonders and work best.
Automation is a lazy task for an smart IT administrator.
Shutdown network computers via command line with batch file
scripting makes an easy task.
Cheers!!!
Comments
Post a Comment