This is used to remove all spaces in a string via substitution.
@echo off set str = This string has a lot of spaces echo %str% set str=%str:=% echo %str%
The key thing to note about the above program is, the : = operator is used to remove all spaces from a string.
The above command produces the following output.
This string has a lot of spaces Thisstringhasalotofspaces