please explaine this command line
Moderator: DosItHelp
please explaine this command line
for /f "tokens=1,2 delims==" %%a in (key.txt) do (set SN=%%a )
Re: please explaine this command line
This command line loops over the content of key.txt.
If the content is something like x=y then it works as follows:
delims== means that the data separator is the equal sign
tokens=1,2 means that you get the first and the second part of an equal-sign-separated line
%%a means that the first part is saved to the dynamic variable %%a (the second is saved to %%b ...)
set SN=%%a means that the content of %%a is saved to SN, so you can work with variable %SN% after the FOR loop.
For my example you would get x in %SN%.
Regards
aGerman
If the content is something like x=y then it works as follows:
delims== means that the data separator is the equal sign
tokens=1,2 means that you get the first and the second part of an equal-sign-separated line
%%a means that the first part is saved to the dynamic variable %%a (the second is saved to %%b ...)
set SN=%%a means that the content of %%a is saved to SN, so you can work with variable %SN% after the FOR loop.
For my example you would get x in %SN%.
Regards
aGerman