Tips for Windows 2000 and Windows Me Trim Input by Using a Batch File D. E. Levine
TIP 2.Limit Names to Eight Characters
You can limit names to eight (8) capital characters when passing them to a batch file. How you do it depends on whether you're using Windows 2000 or Windows Me.
1. Window 2000
When using Windows 2000 you can use the SET command to extract a substring from an environment variable.
Use the comman SET result=%original:~0,8% to set the variable result to 8 characters of the value of the variable Original, starting at the 0th (first) character, but without capitalizing the result.
2. Windows Me
If you're using Windows Me you'll have to write the following batch file in order to use the CHOICE command to split the input into individual letters and then re-assemble a maximum of 8 of the letters.