Create, modify, or display an environment variable in another process

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Joe Caverly
Posts: 18
Joined: 11 Jul 2018 05:05

Create, modify, or display an environment variable in another process

#1 Post by Joe Caverly » 11 Jul 2018 14:21

The SETP command, part of the free TCC-RT, allows one to create, modify, or display an environment variable in another process.

Ref: SETP Command: https://jpsoft.com/help/setp.htm
Ref: TCC-RT: https://jpsoft.com/products/tcc-rt-runtime.html

SETP works by injecting a dll into the specified process and executing a command in that dll to set the environment variable.

On my Windows 7 64-bit system, SETP works great, as long as the other process is a 64-bit process.

If the other process is a 32-bit process, SETP will not work.

JPSoftware, maker of TCC-RT, no longer wants to support 32-bit apps.

Ref: https://jpsoft.com/forums/threads/setp- ... ess.8653/

Is there another method I can use to modify an environment variable in a 32-bit process, from a 64-bit process?

Regards,

Joe

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Create, modify, or display an environment variable in another process

#2 Post by aGerman » 12 Jul 2018 02:23

Changing a foreign process environment is actually not intended. Not even changes in the parent process environment. Child processes inherit the environment from their parent processes, not vice versa. Hacks like DLL injection are needed for that. The only tool I'm aware of is editv. But it allows only to change the environment of the parent process.

Steffen

Post Reply