The Batch file code are as following:
:continue
start myfile.exe
tasklist /FI "IMAGENAME eq myfile.exe" 2>NUL | find /I /N "myfile.exe">NUL
if "%ERRORLEVEL%"=="0" goto :exit
goto :continue
exit:
I tried to write in c and compiled it.
include < stdlib.h >
int main()
{
system(":continue
start myfile.exe
tasklist /FI "IMAGENAME eq myfile.exe" 2>NUL | find /I /N "myfile.exe">NUL
if "%ERRORLEVEL%"=="0" goto :exit
goto :continue
:exit");
return 0;
}
But it is not working. What is going wrong?