Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Possible to compare 2 strings in a batch file case insensitive?

Posted on 2005-03-31
1
Medium Priority
?
6,513 Views
Last Modified: 2008-03-03
I've a batch file where I've:

IF "%USERNAME%"=="MYUSERNAME" .......

Problem is that the test (comparation) is case sensitive, I want to make it insensitive.

Is this possible? If yes, how?

Thanks.

0
Comment
Question by:LMGONCA
1 Comment
 
LVL 86

Accepted Solution

by:
oBdA earned 750 total points
ID: 13670478
Assuming NT4 or later (won't work on Win9x or Me), simply use "/i":
if /i "%UserName%"=="MyUserName" ...
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
In this tutorial, we’re going to learn how to convert Youtube to mp3 for Free. We'll show you how easy it is to make an mp3 from your video clips so that you can enjoy them offline.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question