:TruncateTrailingSpaces setlocal :TruncateTrailingSpaces_1 set var0=[%% %1:~-1 %%] set var0=%var0: =% call set var0=%var0% if "%var0%"=="[ ]" (call:TruncateTrailingSpaces_2 %1&goto TruncateTrailingSpaces_1) set var0=%% %1 %% set var0=%var0: =% call set var0=%var0% endlocal&set %1=%var0%&exit/b0 :TruncateTrailingSpaces_2 set var1=%% %1:~0,-1 %% set var1=%var1: =% call set %1=%var1% exit/b0
Aug 18, 2012
Function: TruncateTrailingSpaces
Receives one parameter - a name of the variable. Works locally. Tested/working in 2000, XP, Windows 7 - should work in the rest as well.
Labels:
batch_tip
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment