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
     
    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
    >
     
    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
     
    Shenan Stanley, Dec 19, 2006
    #4
    1. Advertisements

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. bhisham

    XP workstations unable to download.

    bhisham, Aug 11, 2003, in forum: Windows XP Security
    Replies:
    0
    Views:
    276
    bhisham
    Aug 11, 2003
  2. John
    Replies:
    0
    Views:
    301
  3. Amihai

    Unlocking Locked workstations

    Amihai, Mar 30, 2004, in forum: Windows XP Security
    Replies:
    1
    Views:
    336
    Shenan Stanley
    Mar 30, 2004
  4. Guest

    I need to add Trusted Root CA to 150 Workstations

    Guest, Jun 15, 2004, in forum: Windows XP Security
    Replies:
    1
    Views:
    685
    Miha Pihler
    Jun 15, 2004
  5. Nolan

    Can't access Windows XP workstations in workgroup

    Nolan, Jul 2, 2004, in forum: Windows XP Security
    Replies:
    3
    Views:
    411
    Miha Pihler
    Jul 2, 2004
  6. Guest

    Cannot access remote regstry and remote shutdown

    Guest, Oct 26, 2005, in forum: Windows XP Security
    Replies:
    0
    Views:
    285
    Guest
    Oct 26, 2005
  7. Guest
    Replies:
    1
    Views:
    801
    Guest
    Sep 25, 2006
  8. Guest
    Replies:
    3
    Views:
    359
    Guest
    Apr 6, 2007
Loading...