"%1" is not a switch - it is the first parameter passed to the batch file.
I was guessing that your batch file example was a simple test but
ultimately you're the best judge about the logic in your batch file. I
assume your original "goto" error issue is now resolved.
Jason said:
%1 is the 1st switch after the filename. Why would you have 1a==1a when
that will always be true?
Pegasus (MVP) said:
Here is your current batch file:
if %1a==1a echo 1
if %1a==2a echo 2
It is OK although it doesn't make much sense. Perhaps you wanted to code
it like this:
if 1a==1a echo 1
if 1a==2a echo 2
Now let's have a copy of the batch file that generated the "goto" error!
so far this file works (remove .txt to test)
As you can see there is no spaces either side of [equals][equals].
However, if you run cmd then this file with the cmd screen you will see
the spaces appear.