%VAR1:~0,1% will do it

 

 

...Tim

 

From: mb [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 11, 2008 12:09 PM
To: NT System Admin Issues
Subject: Batch help, please

 

I need to let the user input a name, and then pull the first character
of that name into a variable.  So I get my input like this:

 

set /p var1=Enter folder name (type 'exit' to leave):

if %VAR1% equ exit goto:End

 

And I have a variable named var1 that has a name.  How do I nab the
first character out of that value?

 

 

Thanks in advance.

 

 

 

 

 

~ Upgrade to Next Generation Antispam/Antivirus with Ninja!    ~
~ <http://www.sunbelt-software.com/SunbeltMessagingNinja.cfm>  ~

Reply via email to