1.

Solve : Truncating in a batch file?

Answer» HELLO. I am trying to figure out how to TRUNCATE a variable to only 8 CHARACTERS.  I need to be able to assign only the first 8 characters of %username% to a variable in a batch file.

Does anybody have any IDEAS?  It shouldn't be that hard, but I can't seem to find any information about it.Try this:

CODE: [Select]set t=%USERNAME:~0,8%
Cheers,
[glb]cs[/glb]


Discussion

No Comment Found