shayelk
shayelk

Reputation: 1646

how to determine who invoked a command-prompt window

I'm running a really long list of scripts, some of which call other scripts and therefore open and close new command-prompt windows. At the end of the run I expect to only find one main command-prompt window opened (the one where the main script running all the sub scripts was ran), but I'm left with two. I need to find out which of my scripts opens a new command-prompt and doesn't close it, but running them one-by-one manually is not an option. so the question is: given an open command prompt window, is there a way to determine who called it?

thanks!

Upvotes: 1

Views: 123

Answers (1)

Shlomi Agiv
Shlomi Agiv

Reputation: 1198

before every script, set a specific environment variable that will stay when creating a new shell. then test on the new shell which env is defined

you didn't state your environment, but here's an example:

export TEMP_VAR=var1
script1
export TEMP_VAR=var2
script2

...

Upvotes: 2

Related Questions