Computing.Net > Forums > Programming > Need help with WinXP batch script

Need help with WinXP batch script

Reply to Message Icon

Original Message
Name: The_Gambler
Date: August 9, 2005 at 23:31:02 Pacific
Subject: Need help with WinXP batch script
OS: Win XP Professional
CPU/Ram: All
Comment:

Need help with this:


I shall write a "pre-installer" which will select the package to be installed. To do so it shall fetch the username and according to the first three letters of the username select the package.
Now what I got is the username selected on the command prompt by using "%USERNAME%" which works pretty fine. But now I can't find a way to only take the first three letters to use it in a "if - else" construct.

Can anybody help me out with this?


Regards,
The_Gambler


Report Offensive Message For Removal


Response Number 1
Name: Mechanix2Go
Date: August 10, 2005 at 01:20:56 Pacific
Subject: Need help with WinXP batch script
Reply: (edit)

%username:~0,3%

M2


If at first you don't succeed, you're about average.


Report Offensive Follow Up For Removal

Response Number 2
Name: The_Gambler
Date: August 10, 2005 at 02:54:14 Pacific
Subject: Need help with WinXP batch script
Reply: (edit)

Thank you very much!

This works really nice... ;-)


Report Offensive Follow Up For Removal

Response Number 3
Name: borelli35
Date: August 11, 2005 at 18:08:03 Pacific
Subject: Need help with WinXP batch script
Reply: (edit)

M2!....!Nice! I did not know you could do that and thus have met my 'learn something new every day' quota...thank you!

John W. Borelli
IT Specialist
Hawkeye Security

Link to my email address


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Need help with WinXP batch script

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




How often do you use Computing.Net?

Every Day
Once a Week
Once a Month
This Is My First Time!


View Results

Poll Finishes In 3 Days.
Discuss in The Lounge