Sign in to follow this  
Followers 0
willichan

Detect if included

5 posts in this topic

I already have a strong suspicion that the answer to this is, "No. It can't be done." but I'll ask anyway.

Is there any way for a script to detect whether it is running as the main script, or if it is being included in another script?

Share this post


Link to post
Share on other sites



I have no certain answer, but I think that there is a way to determine if the exe file was extracted (being as a child from other process) or it is the only process. May be this could be done analyzing process table before process and after it. This is my opinion.

Share this post


Link to post
Share on other sites

@electrico

Thank you for your reply. I probably wasn't very clear on what I was looking for.

I am looking to have the script (compiled or not) determine if it is being run as a script, or being included as a UDF.

Share this post


Link to post
Share on other sites

Not possible. The reason is that if you are using #include, it should be a file that is always meant to be #include-d.

Share this post


Link to post
Share on other sites

Not possible. The reason is that if you are using #include, it should be a file that is always meant to be #include-d.

That is what I suspected. Thank you.

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