Batch files are executable scripts that issue a series of DOS or Windows commands. They are highly useful in system automation tasks and have other uses as well. For example, you can use a batch file to remove all of the trailing “whitespace” characters from a variable. Trailing white spaces occur when you press the space bar too many times after entering a value for a variable. You can save space in memory by removing these unnecessary white spaces, because your variable will contain fewer characters. set var=Wasted Space: &rem echo."%var%" for /l %%a in (1,1,31) do if “!var:~-1!"==” " set var=!var:~0,-1! echo."%var%" “Wasted Space: " “Wasted Space:” Writer Bio

How to Remove a Trailing Space in a Batch Variable  10 Steps  - 33