P
Paul Woodman
I've got a service running as Local System account that calls
CreateProcessWithLogonW to run a script as a certain administrator account.
Like so:
STARTUPINFOW si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
CreateProcessWithLogonW(
L"admin", // username
NULL, // domain
L"admin", // password
0, // logon flags
NULL, // No application name (use command line)
&command[0], // command line
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
This worked fine until Service Pack 2 was installed, now the call fails with
'Access is denied'. However, if i change the service to run as the same
'admin' account used in the Create.. call there is no problem. I'd rather
not have to do this.
Anyone else had similar problems and know of a better (proper) solution??
Thanks in advance
Paul
CreateProcessWithLogonW to run a script as a certain administrator account.
Like so:
STARTUPINFOW si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
CreateProcessWithLogonW(
L"admin", // username
NULL, // domain
L"admin", // password
0, // logon flags
NULL, // No application name (use command line)
&command[0], // command line
0, // No creation flags.
NULL, // Use parent's environment block.
NULL, // Use parent's starting directory.
&si, // Pointer to STARTUPINFO structure.
&pi ) // Pointer to PROCESS_INFORMATION structure.
)
This worked fine until Service Pack 2 was installed, now the call fails with
'Access is denied'. However, if i change the service to run as the same
'admin' account used in the Create.. call there is no problem. I'd rather
not have to do this.
Anyone else had similar problems and know of a better (proper) solution??
Thanks in advance
Paul