| Author |
Message |
ib_redbeard
Guest
|
Posted:
Thu Dec 30, 2004 8:59 pm Post subject:
reboot using a batch file? |
|
|
I wanted to reboot a bunch of computers on my domain, and thanks to a
previous post, I found the command:
for /f %x in (machines.txt) do shutdown /m \\%x /r /t 0 /f
Its works perfectly when I inmput it directly the command prompt, but when I
have that in a batch file, it doesn't work. It gives me "-t was unexpected
at this time." I'v etried different things but can't get it to work. Any
idea how to get this to work in a batch file as it does when diectly inputted
into the command prompt? Thanks |
|
| Back to top |
|
 |
Jim Rowland
Guest
|
Posted:
Thu Dec 30, 2004 9:33 pm Post subject:
Re: reboot using a batch file? |
|
|
"=?Utf-8?B?aWJfcmVkYmVhcmQ=?=" <ibredbeard@discussions.microsoft.com>
wrote in news:E301434D-C20E-4C32-A769-30D544433D51@microsoft.com:
| Quote: | for /f %x in (machines.txt) do shutdown /m \\%x /r /t 0 /f
get it to work. Any idea how to get this to work in a batch file as
it does when diectly inputted into the command prompt? Thanks
|
In the batch file, use %%x instead of %x (double up the percent sign).
Should get you what you need.
-=jimmy=- |
|
| Back to top |
|
 |
ib_redbeard
Guest
|
Posted:
Fri Dec 31, 2004 2:13 am Post subject:
Re: reboot using a batch file? |
|
|
Thanks Jim, that worked great. I knew it was something simple :)
"Jim Rowland removethis-softhome.net>" wrote:
| Quote: | "=?Utf-8?B?aWJfcmVkYmVhcmQ=?=" <ibredbeard@discussions.microsoft.com
wrote in news:E301434D-C20E-4C32-A769-30D544433D51@microsoft.com:
for /f %x in (machines.txt) do shutdown /m \\%x /r /t 0 /f
get it to work. Any idea how to get this to work in a batch file as
it does when diectly inputted into the command prompt? Thanks
In the batch file, use %%x instead of %x (double up the percent sign).
Should get you what you need.
-=jimmy=-
|
|
|
| Back to top |
|
 |
|
|
|
|