I have an .exe file that deletes itself on startup. It runs a .bat file that deletes the .exe file and than itself.
file1.exe (compiled batch file):
if "%CD%\file1.exe"=="C:\file1.exe" (
start "file2" /MIN file2.bat
) ELSE (exit)
TSKILL file1 /A /V
ping -n 4 127.0.0.1>nul
However, when I try to run file1.exe on startup it fails to start file2.bat, and therefore it will not delete itself. It almost seems like the START command doesn't work right after booting your computer.
Is there a way to solve this?
(file1.exe is executed on startup by adding a key to the registry: hkey_current_user\software\microsoft\windows\currentversion\run)