Jump to content

autoit: ignore the sensitive Case


Recommended Posts

i have filename that i get from setting file . for example, 8889_1_ER_R1_P1_R34.
i need to get the file from certain folder by referring the filename butt without the P1 part. soo, the folder name will be 8889_1_ER_R1_R34. the 8889_1_ER_R1_P1_R34 file will be in the sub folder of 8889_1_ER_R1_R34. my code is as below:

$getname = StringSplit( $Prog, "_")

$folder = $getname[1] & "_" & $getname[2] & "_" & $getname[3] & "_" &  $getname[4] & "_" &  $getname[6]

$path = "c:\users" & $folder & "\programs\"  & $Prog & ".exe"


    but the problem i have is the sub folder name is either programs, Programs, pRograms, and etc as long its the name is program.
    how can i ignore either upper case or lower case as long the folder name programs?

 

thanks

Link to comment
Share on other sites

  • Moderators

@lattey have you actually tried it? Windows will not allow two folders at the same level regardless of the case. So if you try adding a folder programs, then a folder ProgRams, it will not let you. This script opens the same folder, regardless of the case:

ShellExecute(@UserProfileDir & "\programs")
ShellExecute(@UserProfileDir & "\Programs")
ShellExecute(@UserProfileDir & "\pRograms")
ShellExecute(@UserProfileDir & "\proGrams")
ShellExecute(@UserProfileDir & "\prograMs")
ShellExecute(@UserProfileDir & "\programS")

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

Just an FYI, It will typically take you less time to try something for yourself than it does to post a question. And you are a lot less likely to get help from forum members if you show a pattern of "i didnt try it".

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...