Jump to content

Run script only if parameter was sent


Recommended Posts

I have two scripts, one must be executed by user and the other must be executed by the 1st script.

Lets say, 1st script is executed. User clicks "start", 1st script opens 2nd script and closes it self.

I need to set a parameter on 2nd script so that it will only run if 1st script tells it.

If a user will try to execute 2nd script directly, it will open the 1st script instead or tell the user that "You must run the 1st script."

Help would be very appreciated. Thank you.

Oh, and by any chance is there a way to hide my script from the process on taskmgr? I don't want people killing the process, because the script protects another exe that I can't modify. Something like an anti-hacking tool, to avoid memory edits and stuff?

Edited by madsiddiqui
Link to comment
Share on other sites

Welcome to the forums madsiddiqui!! :)

Seems easy enough. Try something like this:

If $CmdLine[0] < 1 Then
    MsgBox(48, "Warning", "Please run 1st script.")
    Exit
EndIf
More info on running scripts and command line parameters.

You may also want to look at the Run() function.

Taking away the ability to end your program through task manager or the likes isn't usually a good idea. A friendly message indicating activity that should not interrupted should suffice right?

As for the avoiding memory edits etc, maybe some variable/memory block hashing/encryption?

Go with whichever you have the patience to research and implement.

If you get stuck, post away!!

Hope this helps and happy coding! :mellow:

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