I have scripted StripString.bat to remove the last N characters of a string.
The syntax for using StripString.bat is:
call StripString String newString \[Numchar\]
String is the variable name that contains the string. newString is a call directed environment variable that will contain the new string, and Numchar is an optional parameter that contains N, the number of characters to remove. The default is 1.