Jump to content

[solved] File Protection script


Recommended Posts

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 by snowman533

Intermediate AutoIt/Autohotkey User

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...