Trim Quotes

Remove surrounding quotes via FOR command.

Description: The FOR command can be used to safely remove quotes surrounding a string. If the string does not have quotes then it will remain unchanged.
Script:
1.
2.
3.
4.
set str="cmd politic"
echo.%str%
for /f "useback tokens=*" %%a in ('%str%') do set str=%%~a
echo.%str%
Script Output:
 DOS Script Output
"cmd politic"
cmd politic