Check if command's output contains some text
Posted: 20 Jun 2010 06:58
I am trying to write a batch file that has to do the following:
1) run a command that has some output.
2) check if the output contains some text
3) if yes - do something
What I tryed to do is to save the output to a file and then save the data from file to variable:
[command] > c:\temp.txt
set /p RetVal= < c:\temp.txt
del temp.txt
But it doesn't work well.
Anybody has some ideas how to do all these?
Thanks a lot!
1) run a command that has some output.
2) check if the output contains some text
3) if yes - do something
What I tryed to do is to save the output to a file and then save the data from file to variable:
[command] > c:\temp.txt
set /p RetVal= < c:\temp.txt
del temp.txt
But it doesn't work well.
Anybody has some ideas how to do all these?
Thanks a lot!