deleted
If you have its source code, WM_COPYDATA is a good option. Otherwise code injection (but watch the forum rules...)
NIDUD,
Child Processes, MSDN (https://msdn.microsoft.com/en-us/library/windows/desktop/ms682015(v=vs.85).aspx)
...But, this is probably what you're most interested in: Process Security and Access Rights, MSDN (https://msdn.microsoft.com/en-us/library/windows/desktop/ms684880(v=vs.85).aspx)
You will notice that this is the MSDN documentation for the current version of the Windows Operating System. As I recall, access of child process memory from the parent process works differently on older versions of the Windows Operating System.
...If you visit Raymond Chen's Windows Blog site, search for the term: child process,...Child Process Search (https://social.msdn.microsoft.com/search/en-US?rq=site%3Ablogs.msdn.microsoft.com%2Foldnewthing&rn=oldnewthing&query=child+process)
A process inherits its environment from its parent, and the consequences of this simple statement, Raymond Chen (https://blogs.msdn.microsoft.com/oldnewthing/20150915-00/?p=91591/)
deleted
there are numerous batch tricks
tell us exactly what you are trying to do
it sounds like you could just pass the current directory on the command line
(you can get that from API too - lol)
in other words...
make me understand why GetCurrentDirectory won't work for you
deleted
ok - i am still not clear on what you are trying to accomplish
are you writing a program or a batch file or both ?
maybe you want to...
1) GetEnvironmentStrings - create an environment block of the current process
2) modify the environment strings, as desired
3) CreateProcess and pass the address of the new environment block
4) FreeEnvironmentStrings - release the environment memory block
the environment functions may be ANSI or UNICODE - use the same type for both
for batch files, there are many little tricks to use
the SET command has a lot of info in the help
C:\> SET /?>temp.txt
there are a few others, too
i don't remember what they are, but i can probably find them if you're interested
deleted
deleted
deleted