Hi guys I hope you can help me out I have a script that checks for the current user's loginname in different txt files. If the current user's loginname is found in one of the txt files, the script reacts based on that. The text files look something like this: dle oej zaq oei (different usernames) This is an example of the script: $username = @UserName ;pulls username that is logged in
$Dir = "C:\Test\"
Global $Custom[] = ["text01", "text02", "text03", "text04"]
;CHECK LISTS
For $i = 0 To UBound($Custom) - 1
$CustomFile = FileOpen($Dir & $Custom[$i] & ".txt", 0)
$Readtxt = FileRead($CustomFile)
FileClose($CustomFile)
If StringRegExp($Readtxt, $username) Then
do this and that...
EndIf
NextIt works perfectly if the user logs in as xxxx or XXXX (Both lower and upper case characters) So the FileRead function doesn't seem to be case sensitive. But if the user logs in as xxXx (mix of lower and upper case characters), then the username is not recognized in the txt file. Does anyone have a suggestion on how I can fix this? Thanks in advance! - David