remote shutdown multiple workstations

G

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 !
 
S

Shenan Stanley

david said:
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.
 
N

Nipi

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

Shenan Stanley

david said:
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?
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.
 

Ask a Question

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. After that, you can post your question and our members will help you out.

Ask a Question

Top