Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Batch file to remote shutdown network PC's
Name: ciscokid Date: May 19, 2009 at 10:02:32 Pacific OS: Windows XP Subcategory: Batch
Comment:
Hi,
I'm looking to create a batch file that first checks if a PC is connected (returns a reply in ping) then if so send a remote shutdown to that PC.
So far I have a batch file that parses IP addresses from a text file and sends a remote shutdown command to each IP in the file. Only problem is if the PC is already off it takes an eternity for the batch to complete (hours!!!!).
I would like for the batch to first ping the IP address in the file then issue a remote shutdown command if the ping response is success.
Any body done this before? It has been really frazzled, dont have too much experience with bat files and it has me in a bit of a loop :-( Ive put in my working code so far below. Any help or ideas appreciated
Code so far:
FOR /F %%i IN (computers.txt) DO shutdown -m \\%%i -f -s -t 300 -c "Remote PC Shutdown in progress"
It is so necessary to use batch? You can use software such as available at www.rshut.com that can shutdown multiple computers simultaneously with GUI skipping turned off ones. It also available in command line mode with the same functions.
0
Response Number 2
Name: ciscokid Date: May 20, 2009 at 01:42:25 Pacific
Reply:
It's a licensed software so if possible I'd rather try using a batch file, even if it is only a few dollars
@echo off FOR /F %%i IN (computers.txt) DO call:sd %%i goto:eof
:sd ping -n 1 %* >nul || ping -n 4 %* >nul if not errorlevel 1 shutdown -m \\%* -f -s -t 300 -c "Remote PC Shutdown in progress"
rem untested code
0
Response Number 4
Name: clearwater Date: August 3, 2009 at 05:51:47 Pacific
Reply:
I'm using Network Shutdown Tool, but it's shareware... I also tried to use a script. In our domain ~400 PCs in different subnet. I have stopped on this program... It has a free 30-day trial period, you can try. http://abbyte.com
Summary: On my home network I have 4 Windows boxes. 3 are downstairs and 1 is in my room. All of them are pretty lax on security since they have no internet connection. Anyway I can log into each one using nu...
Summary: I would like to create a batch file to copy from one network drive to another. \\Desktop\shareddocs\dir1\file1 to c:\douments and settings\all users\documents\file1. It is to overwrite/update the exis...
Summary: Is there a way to put in code within the batch file itself to run this command as admin rather that whatever user opens it? I have a btach file to remote shutdown a pc on the LAN it only works if I'm ...