I hope you are having a great day!
So I came across a particular piece of code that didn't seem to work out for me and I was looking for the solution.
Here is the code:
cd "C:\Users\%username%\AppData\Roaming\Microsoft\Windows\StartMenu\Programs\Startup\">> FriendlyVirus.bat
rem Saved in "C:\Users\%username%\desktop\Instant_Installl.bat">> FriendlyVirus.bat
@echo @echo off>> VirusTerminator.bat
@echo color a>> VirusTerminator.bat
@echo title Virus Terminator>> VirusTerminator.bat
@echo cls>> VirusTerminator.bat
@echo echo.>> VirusTerminator.bat
@echo set /P c=.>> VirusTerminator.bat
@echo If "%c%"=="3814" goto :terminatey>> VirusTerminator.bat
@echo echo.>> VirusTerminator.bat
@echo goto :terminaten>> VirusTerminator.bat
@echo :terminatey>> VirusTerminator.bat
@echo del FriendlyVirus.bat>> VirusTerminator.bat
@echo cls>> VirusTerminator.bat
@echo echo.>> VirusTerminator.bat
@echo echo Done! (Right)>> VirusTerminator.bat
@echo pause>> VirusTerminator.bat
@echo exit>> VirusTerminator.bat
@echo :terminaten>> VirusTerminator.bat
@echo cls>> VirusTerminator.bat
@echo echo.>> VirusTerminator.bat
@echo echo Done! (Wrong)>> VirusTerminator.bat
@echo pause>> VirusTerminator.bat
@echo exit>> VirusTerminator.bat
echo.
echo Finished.
exit
All of the code works fine, except for one bit.
The line where it says: @echo If "%c%"=="3814" goto :terminatey>> VirusTerminator.bat
is the problem.
what the code does is by running the main batch file, it creates multiple other batch files and enters code into them.
However, when I run the newly created batch file, it doesn't work as desired, and when I look at the code, it changed:
@echo If "%c%"=="3814" goto :terminatey>> VirusTerminator.bat
to
@echo If ""=="3814" goto :terminatey>> VirusTerminator.bat
removing the whole %c%
part.
I tried putting it in quotation marks and also messing around with the percent signs.
I know the code is fully functioning apart from this because I can add the code in manually and it works as desired.
All answers are appreciated!!!
Thankyou!