|
Hey guys,
the stuff you've given me to work with right now is great.
One problem.
My count script uses the IF then statements to determine if its over or less than 10
It then shells to a BLAT command to attach the result.txt file to an email.
The problem is since the script is still running, it makes the file read only and can't be accessed.
I was thinking about moving the count script and if/then script it to its own file and just shell out the running of each one from a "main" file, but if I do that, won't I lose the $count variable and it won't know how many sites are down?
Ya know what I mean? Here is my script:
shell "dir.bat" (This makes the dir.txt file, I can't seem to get it to work within the kixstart script, it doesn't do anything) $count = 0 $FileName = "C:\branches\dir.txt" $ResultFile = "C:\branches\Result.txt" IF Open(1, $FileName) = 0 $x = ReadLine(1) WHILE @ERROR = 0 $count = $count + 1 $x = ReadLine(1) LOOP ENDIF IF Open(2, $ResultFile,5) = 0 $x = WriteLine( 2 , "Log " + $FileName + " reports " + $count + " down sites" + Chr(13) + Chr(10) ) ELSE BEEP ? "failed to open file, error code : [" + @ERROR + "]" ENDIF if $count < 10 shell "lessthan.bat" else shell "greaterthan.bat" endif
|