ChromeFan Posted September 17, 2008 Share Posted September 17, 2008 (edited) i have created a program for my dad's office, there are around 50 computers. i want that my script should only work in office computers. all the computers have the same usernames but a bit different. likeA.F.C Traders1A.F.C Traders2A.F.C Traders3 and so on...now i need a solution which can work to stop the script from running if the username is changed.i have tried this:if @UserName = "A.F.C Traders1" Then MsgBox(0, "Welcome", "Thanks for using this program", 10) Else MsgBox(0, "You are Restricted", "This Program is only For A.F.C Companies") Exit EndIfbut how can i add more names? and what if the company will add more computers to use this program?then they will be not able to run this tool.i need a idea which will match the UserName with "A.F.C" and run the script Else Exit.for example if the Username will Contain "A.F.C" world then script will Run otherwise Not.Thanks! Edited September 17, 2008 by ChromeFan Website: www.cerescode.comForum: www.forum.cerescode.comIRC: irc.freenode.net , Channel: #Ceres--------------------Autoit Wrappers, Great additions to your script (Must See) (By: Valuater)Read It Befor Asking Question Click Here...--------------------Join Monoceres's Forums http://www.monoceres.se--------------------There are three kinds of people: Those who make things happen, those who watch things happen, and those who ask, What happened? Casey Stengel Link to comment Share on other sites More sharing options...
monoceres Posted September 17, 2008 Share Posted September 17, 2008 StringInStr(@UserName,"A.F.C") ? Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Nahuel Posted September 17, 2008 Share Posted September 17, 2008 I'm guessing this would be an approach $UserName=@UserName if StringRegExp($UserName,"A.F.C Traders[0-9](.*?)") Then MsgBox(0, "Welcome", "Thanks for using this program", 10) Else MsgBox(0, "You are Restricted", "This Program is only For A.F.C Companies") ;~ Exit EndIf $UserName="A.F.C Traders2" if StringRegExp($UserName,"A.F.C Traders[0-9](.*?)") Then MsgBox(0, "Welcome", "Thanks for using this program", 10) Else MsgBox(0, "You are Restricted", "This Program is only For A.F.C Companies") ;~ Exit EndIf $UserName="A.F.C Traders15" if StringRegExp($UserName,"A.F.C Traders[0-9](.*?)") Then MsgBox(0, "Welcome", "Thanks for using this program", 10) Else MsgBox(0, "You are Restricted", "This Program is only For A.F.C Companies") ;~ Exit EndIf Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now