This is what happens when I run that code
S:\Test\Batch\After 08-01-09\Tryout>tryme.bat
S:\>SET /P serial= Enter your SERIAL CODE here:
Enter your SERIAL CODE here:qwerty
S:\>if "qwerty" == "3612-3472-631" goto abcd
S:\>echo SET /p qwerty=qwerty 1>>cache.bat
S:\>echo SET /p = 1>>cache.bat
S:\>pause
Press any key to continue . . .
And this is what cache.bat looks like
SET /p qwerty=qwerty
SET /p =
1. If you have a line
@echo off
at the start, it won't echo each line.
2. You have an IF test in the second line and if the test is passed (if what is entered by the user matches the password) then you go to label :abcd. But, the way IF works is that if the test is failed, you just go to the next line, which is the label :abcd! So you're going to go there anyway whatever the user inputs.
3. Why are you echoing this to cache.bat?
SET /p %serial%=%serial%