remote shutdown multiple workstations

Discussion in 'Windows XP Security' started by Guest, Dec 19, 2006.

  1. Guest

    Guest Guest

    Hi !
    I'm using a dos shell script to remotely shutdown my workstations daily with
    the command:
    shutdown /s /m \\ip.address /t 60 /d 0:0 /c "daily shutdown".
    The problem is that I one line for each workstation, and if one of them is
    off, or not connected at that time, the script has to wait before shuting
    down the next.
    Is there a way of doing this simultaneally ?
    Thanks !
     
    Guest, Dec 19, 2006
    #1
    1. Advertisements

  2. david carvalho wrote:
    > Hi !
    > I'm using a dos shell script to remotely shutdown my workstations
    > daily with the command:
    > shutdown /s /m \\ip.address /t 60 /d 0:0 /c "daily shutdown".
    > The problem is that I one line for each workstation, and if one of
    > them is off, or not connected at that time, the script has to wait
    > before shuting down the next.
    > Is there a way of doing this simultaneally ?


    This batch script:

    for /f %%u in (listofcomputers.txt) do (
    start shutdown.exe -s -m \\%%u -f -t 60 -d 0:0 -c "daily shutdown"
    )

    And then have your list of machine names/ips in the given text file, one
    name/ip per line.

    --
    Shenan Stanley
    MS-MVP
    --
    How To Ask Questions The Smart Way
    http://www.catb.org/~esr/faqs/smart-questions.html
     
    Shenan Stanley, Dec 19, 2006
    #2
    1. Advertisements

  3. Guest

    Nipi Guest

    Hi
    What is the /f in front of "for", is it what it tells the batch not to
    wait for each workstation?


    Shenan Stanley wrote:
    > david carvalho wrote:
    > > Hi !
    > > I'm using a dos shell script to remotely shutdown my workstations
    > > daily with the command:
    > > shutdown /s /m \\ip.address /t 60 /d 0:0 /c "daily shutdown".
    > > The problem is that I one line for each workstation, and if one of
    > > them is off, or not connected at that time, the script has to wait
    > > before shuting down the next.
    > > Is there a way of doing this simultaneally ?

    >
    > This batch script:
    >
    > for /f %%u in (listofcomputers.txt) do (
    > start shutdown.exe -s -m \\%%u -f -t 60 -d 0:0 -c "daily shutdown"
    > )
    >
    > And then have your list of machine names/ips in the given text file, one
    > name/ip per line.
    >
    > --
    > Shenan Stanley
    > MS-MVP
    > --
    > How To Ask Questions The Smart Way
    > http://www.catb.org/~esr/faqs/smart-questions.html
     
    Nipi, Dec 19, 2006
    #3
  4. david carvalho wrote:
    > I'm using a dos shell script to remotely shutdown my workstations
    > daily with the command:
    >
    > shutdown /s /m \\ip.address /t 60 /d 0:0 /c "daily shutdown".
    >
    > The problem is that I one line for each workstation, and if one of
    > them is off, or not connected at that time, the script has to wait
    > before shuting down the next.
    > Is there a way of doing this simultaneausly?


    Nipi wrote:
    > What is the /f in front of "for", is it what it tells the batch not
    > to wait for each workstation?


    for /f --> command to process files line-by-line
    /F breaks up the line at each blank space, and any blank lines are
    skipped...

    See:
    http://www.ss64.com/nt/for_f.html

    The 'start' is what opens up a new process for each new line - thus there is
    no waiting - as you have generated a new process for each entry in the text
    file.

    --
    Shenan Stanley
    MS-MVP
    --
    How To Ask Questions The Smart Way
    http://www.catb.org/~esr/faqs/smart-questions.html
     
    Shenan Stanley, Dec 19, 2006
    #4
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. bhisham

    XP workstations unable to download.

    bhisham, Aug 11, 2003, in forum: Windows XP Security
    Replies:
    0
    Views:
    200
    bhisham
    Aug 11, 2003
  2. John
    Replies:
    0
    Views:
    227
  3. Guest

    Cannot access remote regstry and remote shutdown

    Guest, Oct 26, 2005, in forum: Windows XP Security
    Replies:
    0
    Views:
    196
    Guest
    Oct 26, 2005
  4. Guest
    Replies:
    1
    Views:
    721
    Guest
    Sep 25, 2006
  5. Guest
    Replies:
    3
    Views:
    298
    Guest
    Apr 6, 2007
Loading...

Share This Page