| Was Unexpected At This Time

October 5, 2010 at 21:48:33
Specs: N/A
I'm using the following command:

for /f %a in ('ping -n 1 192.168.1.1^ | findstr /C:"Received = 0" ') do shutdown -s -f -t 5

then get the error message as "| was unexpected at this time."


Actually, i use a bat script for Windows server 2003: http://pastie.org/1202314 , but when i run it, i get a error as above.

Anyone help me, plz!


See More: | Was Unexpected At This Time

Report •


#1
October 6, 2010 at 14:52:39
for /f %a in ('ping -n 1 192.168.1.1 ^| findstr /C:"Received = 0" ') do shutdown -s -f -t 5

Can I put a question here?


Report •

#2
October 6, 2010 at 21:03:07
i tried to separat to 2 command line, then it done. :)

::make a file output.txt in C:\
ping -n 1 %host% > C:\output.txt
for /f %%a in ('findstr /C:"Received = 0" C:\output.txt ') do call :parse


Report •

Related Solutions


Ask Question