¦Find's exit codes
¦The following list shows each exit code and a brief description of its
¦meaning:
¦
¦0
¦ The search was completed successfully and at least one match was found.
¦
¦1
¦ The search was completed successfully, but no matches were found.
¦
¦2
¦ The search was not completed successfully. In this case, an error
¦ occurred during the search, and FIND cannot report whether any matches
¦ were found.
¦
¦You can use the ERRORLEVEL parameter on the <If> command line in a batch
¦program to process exit codes returned by FIND.
--
----------------------------------------------------------
War on the Pachyderms Terrorists
http://www.counterpunch.org/wilson09012004.html
"Nathan H" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> Hi all
>
> I'm trying to create a batch script on Windows Server 2003 (commands should
> be relevent to 2000 also) that:
>
> - cleans up any temp files
> - analyzes a partition and records the info to a log file
> - checks the created log file to see whether defrag needs to take place
>
> The 3rd point is the problem I have.
>
> I've managed to output defrag's analyze report but I'm having trouble
> finding
> a command that allows me to check that log file for the word "should" and
> then
> base an outcome if it finds it i.e.
>
> output.log -----> "Should" ---> Yes ----> Run defrag
> ----> No -----> Finish
>
> Hope that makes sense.
>
> Any one have any ideas?
>
> I've tried using FINDSTR but all I can get is it repeating the line
> "should" was in and I cant think how to include it in a If & GOTO
> routine.
>
> Many Thanks,
>
> --
> Nathan Harmsworth
> IT / Network Administrator
> Ysgol Bro Ddyfi (Edu)
>
>