msvisual.com Forum Index
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CreateProcessWithLogonW- process gets created without proper

 
Post new topic   Reply to topic    msvisual.com Forum Index -> VB WinAPI
Author Message
Ashish



Joined: 09 Jan 2008
Posts: 1

PostPosted: Wed Jan 09, 2008 3:53 am    Post subject: CreateProcessWithLogonW- process gets created without proper Reply with quote

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

Archived from group: microsoft>public>vb>winapi
Back to top
View user's profile Send private message
MikeD



Joined: 04 Oct 2007
Posts: 3348

PostPosted: Thu Jan 10, 2008 2:30 am    Post subject: Re: CreateProcessWithLogonW- process gets created without pr Reply with quote

"Ashish" wrote in message @microsoft.com...
> 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.
>

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.

--
Mike
Microsoft MVP Visual Basic
Back to top
View user's profile Send private message
SMussler



Joined: 12 Nov 2007
Posts: 21

PostPosted: Sun Jan 13, 2008 3:58 am    Post subject: Re: CreateProcessWithLogonW- process gets created without pr Reply with quote

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

"Ashish" wrote in message @microsoft.com...
> 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
Back to top
View user's profile Send private message
Mark Yudkin



Joined: 04 Oct 2007
Posts: 198

PostPosted: Sun Jan 13, 2008 2:28 pm    Post subject: Re: CreateProcessWithLogonW- process gets created without pr Reply with quote

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.

"Ashish" wrote in message @microsoft.com...
> 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

Back to top
View user's profile Send private message
Display posts from previous:   
Related Topics:
CreateProcessWithLogonW Hi! I'm running application with with parameter to access a folder that my user don't access. With this parameter my application don't show my own documents and desktop folders, my printers, etc. I tried to use C

CreateProcessWithLogonW -> Param How can I create a process calling a file named "eins.exe" with the param "/startIRM"? Calling "eins.exe" without params works verry fine. But if I add the params to the lpApplication string, the LastDLLError returns the code 123. Please help me. I'm tryi

CreateProcessWithLogonW on Vista We are using a tailormade ERP solution, that is still growing. To keep the problems on the network and local computers down to a minimum, users are all running as standard users (on the domain aswell on their local machines). But because the ERP is changi

VB SAVEARRAY proper way for destroying ArrPtr - returns pointer to Array Data() - some array byte, integer, long,... lpSA = ByVal lpSA is this same as: Erase Data cause I don't see why it would not be, or I make mistake ? [SolarAngel]

Access Denied Error when using CreateProcessWithLogonW Hi All, I am getting an error "ACCESS DENIED" with error no.5 when using for executing an external program. I have written the code in VB6 and it works when in Application but not through ASP Pages. My System is Windows 2003 Enterp
Post new topic   Reply to topic    msvisual.com Forum Index -> VB WinAPI All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group