Declined CMDLINE and CMDLINE2

May 20, 2008
11,867
121
Syracuse, NY, USA
I'm not sure what to suggest. I have been doing some programming involving environments, and I've looked at the environments of many programs.

Here, TCC runs a logon script which, among other things, starts PowerPro and AutoHotKey. I start almost everything from one of those two programs or from TCC itself. And almost every program I run has CMDLINE and/or CMDLINE2 set; the ones started by PowerPro and AutoHotKey get ancient (from login time) values for those variables. In any case, they're meaningless to those programs.

How about a way to keep CMDLINE and CMDLINE2 from being inherited by executables?
 
A couple of things (not tested).
Code:
Start /I - Inherit the default (startup) environment, rather than the current environment.

Code:
Set /m - If a variable name is specified, change it to the original value when TCC started.
If no name is specified, revert the entire environment to the original environment when TCC started.

Joe
 
Aug 23, 2010
678
9
And almost every program I run has CMDLINE and/or CMDLINE2 set; the ones started by PowerPro and AutoHotKey get ancient (from login time) values for those variables. In any case, they're meaningless to those programs.
There's always variables which are meaningless to a given program.
Why would any given one should be an exception?