Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / January 2008



Tip: Looking for answers? Try searching our database.

CreateProcessWithLogonW- process gets created without proper env v

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ashish - 09 Jan 2008 06:53 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.