%%~variable in batch

June 2, 2011 at 00:33:31
Specs: Windows 7
whats the meaning of this syntax?

See More: %%~variable in batch

Report •

June 2, 2011 at 06:45:59
Stated the ~ modifier applies to external and internal variables only, i.e. those on the command tail referred as %1, %2 and so on and those coded in FOR loops as %%a, %%b..., the %~ without other nodifiers forces to strip out the double quotes embracing the operand. Example:

mybat "C:\Program Files\SuperTools"

may be read inside the batch by coding

set Folder=%~1

resulting in Folder set to C:\Program Files\SuperTools. To know more type FOR /? and read the list of allowed modifiers at the bottom of the quick help.

Report •
Related Solutions

Ask Question