Reading output from CreateProcessWithLogonW

  • Thread starter Thread starter Balamurugan KR
  • Start date Start date
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
 
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.
 
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
 
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.
 
Back
Top