Thank you Kurt for your reply. I followed your suggestion and found a solution to my issue. I've added following lines of code into my vbscript. Dim logfileobj Dim logfile Set logfileobj = fso.OpenTextFile(Wscript.ScriptName & ".log", 1) logfile = logfileobj.ReadAll If InStr(1,logfile, "ERROR", 1) <> 0 then wscript.quit(2) end if This will read the log file and search for the word ERROR (added a parameter '1' for case insensitive search). If found, then it will return the execution to command prompt with ERRORLEVEL = 2. Thank You.
... View more