Anyone know what the differences are between those for batch files. I've seen some examples where they are used but haven't been able to figure out exactly what's going on as it seems different commands handle it differently (i.e. FOR). I'm trying to figure out a way for trimming out a portion of a string read in from a file using the for command. I'm just having trouble finding any documentation on the differences between %~var and %var, obviously there is a difference as running
set str="cmd politic"
echo.%str%
for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a
echo.%str%
Works correctly in trimming " " out.