Link to home
Start Free TrialLog in
Avatar of maurice cristen
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\output.txt , so when finds the word ''error #10054 (Unknown error)'' inside Output.txt then the ''mskscss'' process is stopped.

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%"
)

Open in new window


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
Avatar of Carl McGee
Carl McGee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maurice cristen
maurice cristen

ASKER

thank you