Reading output from CreateProcessWithLogonW

B

Balamurugan KR

Hi,

I used CreateProcessWithLogonW api to start an app, the app is a console
app, for eg., test.cmd (This cmd file has one command echo %username%)
Now In my main process i want to the read the output of the test.cmd


thanks
 
W

Willy Denoyette [MVP]

What programming language are you using?
What is the security context of the caller? (or is the caller another
windows UI or commandline application?)
Is your only purpose to make things such complicated just to call echo
%username%, or do you have special reasons to call CreateProcessWithLogonW?.

Willy.
 
B

Balamurugan KR

my programming language is C#
well my requirement is to impersonate and start a process.
Well the purpose of my app is not as simple as echo %username%, start a
process under different user context



Bala
 
D

Dave

I don't know how to capture the output after using CreateProcessWithLogonW,
but if you use the Process class to start the app then it's a trivial matter
to capture the output. You might want to look into impersonating the client
within the context of .net and then using the process class to start the
app.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top