snowman533 Posted April 8, 2009 Share Posted April 8, 2009 (edited) hey guys i am trying to make a peice of code that stops the attached program from running if the program is run from the program files or windows directory if @ScriptDir = @WindowsDir Then MsgBox(0, "Error", "Sorting in any parts of the Windows folder will cause the computer to cease function, Terminating Program") Exit Else if @ScriptDir = @ProgramFilesDir Then MsgBox(0, "Error", "Sorting in any parts of the program files section will cause programs to cease functioning, Terminating Program") Exit Endif Endif now the code works fine if the script is run from the program files and windows directory, however i wish to include all subdirectories within the windows and program files directories thanks in advance Edited April 9, 2009 by snowman533 Intermediate AutoIt/Autohotkey User Link to comment Share on other sites More sharing options...
monoceres Posted April 8, 2009 Share Posted April 8, 2009 Simple If StringLeft(@ScriptDir,StringLen(@WindowsDir))=@WindowsDir Or StringLeft(@ScriptDir,StringLen(@ProgramFilesDir))=@ProgramFilesDir Then Exit Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
snowman533 Posted April 9, 2009 Author Share Posted April 9, 2009 thanks works perfect Intermediate AutoIt/Autohotkey User 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