User Command for hashing console programs

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
solid
Power Member
Power Member
Posts: 747
Joined: 2004-08-09, 11:20 UTC

Re: User Command for hashing console programs

Post by *solid »

Horst.Epp wrote: 2021-06-05, 16:11 UTC
solid wrote: 2021-06-05, 15:59 UTC
Dalai wrote: 2021-06-05, 15:50 UTC 2solid
See my explanation above: https://www.ghisler.ch/board/viewtopic.php?p=402502#p402502

Regards
Dalai
The bottom line is that environmental variables are not supported in the parameters field. They are not expanding to their values.
We agree on this, don't we?

But I don't agree that we should expect from external programs to expand TC's internal variables, even if the programs are written for TC itself.
For any external program which is started from TC there is no difference between TC internal variables
and any other, they can all be expanded if the program does it at all.
Wait a minute. External program doesn't support internal evnvars (ex. %COMMANDER_PATH%).

Are you saying that if such program is started from TC with literal %COMMANDER_PATH% as a parameter send to the program, the program can use its value as parametar, not the literal string?
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: User Command for hashing console programs

Post by *Dalai »

2solid
Internal environment variables don't exist, at least not in the sense you probably mean. Just test it yourself and launch a CMD from within TC. Does it show variables like %COMMANDER_PATH%? Yes, of course it does, because environment variables are inherited to child processes (by default). So every program launched from/by TC has these variables. You can inspect the environment variables of any process with Process Hacker or Process Explorer and you'll see that any processes which have TC as their parent have these variables set.

And just like the default Windows environment variables (e.g. %SystemRoot%) they can be expanded normally. It's just that the launched program must do so. In other words: If this case wasn't about %COMMANDER_PATH% but %SystemRoot% instead, it would have been the exact same problem because lst2mlt doesn't expand env variables.

I hope that make things a lot clearer.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
solid
Power Member
Power Member
Posts: 747
Joined: 2004-08-09, 11:20 UTC

Re: User Command for hashing console programs

Post by *solid »

2Dalai
Yes, I understand now. Thank you for clarifications.

But if TC supported envars in the parameters field, we wouldn't depend if the external program expands them.
User avatar
Dalai
Power Member
Power Member
Posts: 9364
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: User Command for hashing console programs

Post by *Dalai »

2solid
Yes, that's true. However, there are paths/variables that are not to be expanded. I remember a case where a directory like %AppData% was created, literally. Some case of "virtual apps" (can't remember the exact term) of/for VMware or something. If TC expanded variables regardless, such paths would become inaccessible in the worst case. In other words: buttons would have to provide an option whether or not TC should expand environment variables before running the command.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Post Reply