Re: Batch help please

2011-08-16 Thread Andrew S. Baker
Two options based on what you have: set FOLDER=%%a set FIRSTCHAR=!FOLDER:~0,1! if /i *!FIRSTCHAR!*==A goto :MAPA if /i *!FIRSTCHAR!*==B goto :MAPB if /i *!FIRSTCHAR!*==C goto :MAPC GOTO :END Or set FOLDER=%%a set FIRSTCHAR=!FOLDER:~0,1! GOTO MAP*!FIRSTCHAR!* GOTO :END Then continue on w

RE: Batch help, please

2008-02-11 Thread Tim Evans
%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

Batch help, please

2008-02-11 Thread mb
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 characte