SysChat

SysChat (http://www.syschat.com/forum.php)
-   Development (http://www.syschat.com/software-support/development/)
-   -   Problem when creating batch file for shutdown multiple computers in LAN (http://www.syschat.com/problem-when-creating-batch-file-shutdown-4411.html)

bhanuk 03-18-2009 06:54 AM

Problem when creating batch file for shutdown multiple computers in LAN
 
hi all,

I am working as a system administrator around with 90 systems and using server 2003.all systems are windows xp

I want to shutdown all 90 systems at once.it can be possible with batch file using "SHUTDOWn" command
I worte the batch file using that command but it is not working

My Batch file like this

Shutdown -s -m \\Test1 -t 60 -c "Your systems will be shutdown within 1 minite. please save your work"
Shutdown -s -m \\Test2 -t 60 -c "Your systems will be shutdown within 1 minite. please save your work"
Shutdown -s -m \\Test3 -t 60 -c "Your systems will be shutdown within 1 minite. please save your work"
Shutdown -s -m \\Test4 -t 60 -c "Your systems will be shutdown within 1 minite. please save your work"

this is my batch file.this is not working...please help me..

Note: When i exceute the same command form command prompt it will work fine...for that i have to type that same command for 90 times to shutdown all compters.

i am using another batch file..it shows like this...

@Echo off
cd\
Echo bunny=Program
REM ****************************
REM * Program Variables *
REM ****************************

set varcomputer=Test1
goto loop
:Test1

set varcomputer=Test2
goto loop
:Test2


Exit

REM ****************************
REM * Program *
REM ****************************

:loop
echo Shutting down %varcomputer%.
shutdown -s -m \\%varcomputer% -t 600 -c “The computer is shutting down. Please save your work.”
goto %varcomputer%

This is also not working..

Please any body help me....or tell me the code for do that...

Thanks in Advance..

vikaskumargdra 04-07-2009 07:15 AM

To shutdown
shutdown -m \\IP HERE -t TIME IN SECONDS HERE -c MESSAGE HERE -s

To Abort
shutdown -m \\IP HERE -a

I hope this will work.:icon_wink:

benjamingreggsmith 04-12-2009 10:30 AM

I remember being able to shutdown computers with either ip addresses or like you were doing: network names. the only problems i found were setting domain names and especially that the batch file will have to be launched from an administrative account or with an account with a higher privilege level than the users of the PCs you are trying to shutdown otherwise you get a windows security 'Access is denied' error. i am however no too sure on what switches you should use. try shutdown.exe /? and take it from there.


All times are GMT -4. The time now is 04:08 PM.


Copyright © 2005-2013 SysChat.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54