batch file - TASKLIST Restart a program that crashed -
why doesn't work ? if program crashes want restart.
tasklist /nh /fi "imagename eq filezilla.exe" /fi "status eq running" | find /i "filezilla.exe" > nul && ( exit ) || ( echo server not running or not responding taskkill /f /im filezilla.exe timeout 10 start c:\program files\filezilla ftp client\filezilla.exe )
you try start c:\program
3 paramters: files\filezilla
, ftp
, client\filezilla.exe
.
you have quote paths/filenames spaces.
because start
takes first quoted parameter windows title, give dummy title:
start "" "c:\program files\filezilla ftp client\filezilla.exe"
note: there should no need use start
exe. just:
"c:\program files\filezilla ftp client\filezilla.exe"
should work.
Comments
Post a Comment