reboot using a batch file?
Windows Server Forum Index Windows Server
Server discussion on Windows platform.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web winserverhelp.com
reboot using a batch file?

 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming
Author Message
ib_redbeard
Guest





Posted: Thu Dec 30, 2004 8:59 pm    Post subject: reboot using a batch file? Reply with quote

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? Reply with quote

"=?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? Reply with quote

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
 
Post new topic   Reply to topic    Windows Server Forum Index -> Programming All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




New Topics Powered by phpBB