Sign in to follow this  
Followers 0
madsiddiqui

Run script only if parameter was sent

3 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
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:

Share this post


Link to post
Share on other sites

Thank you :mellow: ... I'm coding on it... Thanks for the tips...

Share this post


Link to post
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
Sign in to follow this  
Followers 0