Hi,
I am trying to create a process with the API: CreateProcessWithLogonW. The
process (say, CMD.EXE) which gets created doesnt have the environment
variables which I have explicitly passed into it as the parameter. The same
environment block works for CreateProcessAsUser, but doesnt give me the same
results when used with CreateProcessWithLogonW(). The difference in the list
of the environment variables could be seen using the "set" command in the
command prompts that I am creating using the APIs.
I am looking for a quick reply. I really would appreciate any help regarding
this.
Many thanks in advance,
Ashish
MikeD - 10 Jan 2008 02:30 GMT
> Hi,
> I am trying to create a process with the API: CreateProcessWithLogonW. The
[quoted text clipped - 10 lines]
> regarding
> this.
Post your code. How are we supposed to know what you may be doing wrong if
we can't see what exactly you're doing.

Signature
Mike
Microsoft MVP Visual Basic
SMussler - 13 Jan 2008 03:58 GMT
When I need environment variables set, I write everything to a temporary
.bat file and then run that with a shell command.
Not sure if that will help.
Steve Mussler
> Hi,
> I am trying to create a process with the API: CreateProcessWithLogonW. The
[quoted text clipped - 13 lines]
> Many thanks in advance,
> Ashish
Mark Yudkin - 13 Jan 2008 08:28 GMT
You need to do this yourself with CreateEnvironmentBlock, and then pass it
to CreateProcessWithLogonW. You will probably also need to call
LoadUserProfile. Since this is all stated in the MSDN documentation for
CreateProcessWithLogonW, I presume you have a bug somewhere. Post your code.
> Hi,
> I am trying to create a process with the API: CreateProcessWithLogonW. The
[quoted text clipped - 13 lines]
> Many thanks in advance,
> Ashish