Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
September 8, 1998
In tip 537, we learned how to perform Environment Variable string substitiution.
To strip spaces from an environment variable, you can use the FOR command:
for /f %i in ("%Variable%") do set Variable=%i
If you want to include this in a batch job, them:
for /f %%i in ("%Variable%") do set Variable=%%i
You May Also Like