CreateProcessWithLogonW : unable to start process
Posted
by
Vivek
on Stack Overflow
See other posts from Stack Overflow
or by Vivek
Published on 2012-11-02T16:47:16Z
Indexed on
2012/11/02
17:01 UTC
Read the original article
Hit count: 181
Hi I am completely new to programming. And please someone help me.
I am trying to start a pocess from a service. I need to start the new process by prompting user to enter admin credentials.
I was trying to use CreateProcessWithLogonW()
.
Am I using the right function. I tried to give input username, password, domain as localhost. I gave full pathe to the .exe file that i need to start.
Here is the piece of code.
CreateProcessWithLogonW(L"Administrator",
L"localhost",
L"password",
0,
NULL,
L"c:\myupdates\myapp.exe",
NORMAL_PRIORITY_CLASS | CREATE_CONSOLE,
NULL,
NULL,
&si,
&pi);
Si.cb = sizeof(si);
Si.lpDesktop = L"winsta0\\default";
But the process never started. Can you guys tell me what I am doing wrong. And what do I need to do to promt user to enter credentials of administrator instead of hardcoding it.
© Stack Overflow or respective owner