Computing.Net > Forums > Programming > Batch file to remote shutdown network PC's

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

Reply to Message Icon

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"




Sponsored Link
Ads by Google

Response Number 1
Name: al_v
Date: May 19, 2009 at 17:37:00 Pacific
Reply:

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


0

Response Number 3
Name: reno
Date: May 20, 2009 at 11:13:32 Pacific
Reply:

@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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Batch file to remote shutdown network PC's

Batch file to remotely shutdown www.computing.net/answers/programming/batch-file-to-remotely-shutdown-/13703.html

Batch file to copy from network dri www.computing.net/answers/programming/batch-file-to-copy-from-network-dri/14488.html

admin priveles for batch file www.computing.net/answers/programming/admin-priveles-for-batch-file/17831.html