1.

Solve : Character limit on variables within bat files?

Answer»

I want to know if there is a way to limit the number of characters on an input variable within a .bat file. Using the %1 command to read in a variable, I want to limit this variable to 8 characters.
example: test.bat is the name of the bat file and within the bat file there is the following command:
SET name=%1

c:\>test 123456789

I would like name to be equal to 12345678 RATHER than 123456789.

Any help is appreciated, thanks.This may be helpful:

CODE: [Select]set name=%1
set name=%name:~0,8%

8-)ok, this has nothing to do with your question, so please FORGIVE me.

I have gone brain dead today. I was sent a word file that is password protected. I know I can remove the password protect from the word file but I am having a brain burp and can't for the life of me remember how. I saved it to a floppy file. I need to remove the password protect to use it as a WORKING copy for a report I am processing. Please help me and forgive the intrusion.



Discussion

No Comment Found