maurice cristen
asked on
batch file stop wait 3 min. and restart .exe if finds this error message?
I have this script who works fine:
1.This is output.txt path--> C:\Windows\windefender\out put.txt , so when finds the word ''error #10054 (Unknown error)'' inside Output.txt then the ''mskscss'' process is stopped.
Now can anyone help me add this?So after ''mskscss'' process is stopped, wait 3 minutes and then restart my service,with a new command something like this: net start mskscss ...etc..
1.This is output.txt path--> C:\Windows\windefender\out
SetLocal EnableDelayedExpansion
set FNLog=C:\Windows\windefender\output.txt
if exist "%FNLog%" (
find " error #10054 (Unknown error)" "%FNLog%"
if !errorlevel! equ 0 NET STOP "mskscss (managed by AlwaysUpService)"
ECHO del /q "%FNLog%"
)
Now can anyone help me add this?So after ''mskscss'' process is stopped, wait 3 minutes and then restart my service,with a new command something like this: net start mskscss ...etc..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER