Announcement

Collapse
No announcement yet.

Problem when creating batch file for shutdown multiple computers in LAN

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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..

  • #2
    Re: Problem when creating batch file for shutdown multiple computers in LAN

    Don't know too much about scripting but here is a tool you could use.


    http://www.safe-install.com/programs...n-manager.html

    Comment


    • #3
      Re: Problem when creating batch file for shutdown multiple computers in LAN

      Maybe its better to write it all in vbs.
      But try this batch first,
      Code:
      @echo off & color 6a
      Title Remote shutdown in progress
      
      Call:Shutdown \\Test1  &echo.done \\Test1
      Call:Shutdown \\Test2  &echo.done \\Test2
      Call:Shutdown \\Test3  &echo.done \\Test3
      Call:Shutdown \\Test4  &echo.done \\Test4
      
      Echo/&echo.Finished
      pause>nul
      
      goto:eof ---------------------------
      :Shutdown
      Set "msg2usr=Your systems will be shutdown within 1 minite. please save your work"
      start ""/Min /w SHUTDOWN.exe -s -m %* -t 60 -c "%msg2usr%"
      goto:eof ---------------------------
      \Rems

      This posting is provided "AS IS" with no warranties, and confers no rights.

      __________________

      ** Remember to give credit where credit's due **
      and leave Reputation Points for meaningful posts

      Comment

      Working...
      X