Solved why do we use %% before a variable in batch file in

December 6, 2015 at 01:26:17
Specs: Windows 7
i want the reason why we use the double percent sign (%%) before a variable..eg.-%%a.
also what is delim ?. and what is the meaning of /f and /p in batch file. plzz ans in brief.thank you !!!!

See More: why do we use %% before a variable in batch file in

Report •

#1
December 6, 2015 at 05:51:32
✔ Best Answer
I'm not 100% positive why there are double percent signs, but in the command line, you just use one, so I guess it is escaped.
A delim, aka. delimiter is the character you want to split two or more values on a line, eg."10,38,15,abc", where the delimiter is ",". if you start with %%A, then %%A would be 10, %%B would be 38, %%C would be 15 and so on.

As far as I know, there is no "/p" in FOR, but if you're thinking about "SET /P" then the /P means prompt.

In FOR, you have /D, /L, /R and /F.

You can read about each option in CMD by typing "FOR /?". Same goes for nearly every other command, like "SET /?" "IF /?" etc.

Marking answers that solve, or help helps you solve a problem as "Best Answer" also helps other people solve similiar ones in the future.

message edited by RainBawZ


Report •

#2
December 6, 2015 at 07:01:47
"Marking answers that solve, or help you solve a problem as "Best Answer" also helps other people solve similar ones in the future."

I hate it when people try to solicit "Best Answers". It's forbidden on many forums.


Report •

#3
December 6, 2015 at 08:26:15
aniket8411: i want the reason why we use the double percent sign (%%) before a variable..eg.-%%a.
Versus what, exactly?

aniket8411: also what is delim ?. and what is the meaning of /f and /p in batch file.
Open a Command Prompt, type your command, and add /? to the end of it to see the documentation.

FOR /?

How To Ask Questions The Smart Way


Report •
Related Solutions


Ask Question