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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Need help with WinXP batch script

Reply to Message Icon

Name: The_Gambler
Date: August 9, 2005 at 23:31:02 Pacific
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



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: August 10, 2005 at 01:20:56 Pacific
Reply:

%username:~0,3%

M2


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


0

Response Number 2
Name: The_Gambler
Date: August 10, 2005 at 02:54:14 Pacific
Reply:

Thank you very much!

This works really nice... ;-)


0

Response Number 3
Name: borelli35
Date: August 11, 2005 at 18:08:03 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Need help with WinXP batch script

Batch Script Help Needed www.computing.net/answers/programming/batch-script-help-needed/14475.html

Need advice on a batch script www.computing.net/answers/programming/need-advice-on-a-batch-script/19701.html

Again need help with WinXP batch www.computing.net/answers/programming/again-need-help-with-winxp-batch/13178.html