|
-
January 25th, 2003, 02:07 PM
#1
How to use CreateProcessWithLogonW
I have been trying to get my code to log on as another user and start a process on the local computer "ROUGHRIDER8" using another local users credentials "oluwaseun/oluwaseun".
My code generates error 87 i.e. The parameter is incorrect. ERROR_INVALID_PARAMETER
Can anyone offer code that works or any guideline on this new SDK API. My Operating system is Windows 2000 using Visual C++ 6.0 SP4
Cheers
Gbola
Code
BOOL ki=CreateProcessWithLogonW(
L"oluwaseun", // user's name
L"ROUGHRIDER8", // user's domain
L"oluwaseun", // user's password
CREATE_DEFAULT_ERROR_MODE+CREATE_NEW_CONSOLE+CREATE_NEW_PROCESS_GROUP,//LOGON_NETCREDENTIALS_ONLY, // logon option
(LPCWSTR)&jola[0], // executable module name
NULL, // command-line string
NORMAL_PRIORITY_CLASS, // creation flags
NULL, // new environment block
L"c:\\", // current directory name
NULL, // startup information
&procinfo // process information
);
-
January 25th, 2003, 02:21 PM
#2
You have to use OR to combine flags:
CREATE_DEFAULT_ERROR_MODE+CREATE_NEW_CONSOLE+CREATE_NEW_PROCESS_GROUP
should be changed to:
CREATE_DEFAULT_ERROR_MODE | CREATE_NEW_CONSOLE | CREATE_NEW_PROCESS_GROUP
Also make sure the jola variable is declared a WCHAR not char (you didn't provide us the declaration of this variable)
Dan
-
February 14th, 2003, 10:45 AM
#3
How to logon to a remote machine on the LAN and start a process?
Hi folks,
I am currently facing the problem as specified in the topic question. All I need to do is logon to a remote machine in the LAN and start an executable. The catch is I cannot use sockets. CreateProcessWithLogonW allows me to logon to the domain on my own machine using a different user id and password but how to achieve the same on a remote machine. Is it possible? If yes, kindly guide me.
ciao.
Life is short, enjoy it with a smile as long as it lasts.
User error. Replace User and press any key when ready. - Anonymous
-
February 16th, 2003, 12:30 PM
#4
I don't believe that's possible. If you want to logon to another machine, you'll have to use some sort of socket to communicate with it at some point. Why aren't you allowed to use sockets?
-
February 17th, 2003, 07:53 AM
#5
Coz the client says so
Hi mate,
I actually need to do this for our client. And he does not want us to use sockets. Guess will have to talk to the client. Will try to update regularly.
ciao
Life is short, enjoy it with a smile as long as it lasts.
User error. Replace User and press any key when ready. - Anonymous
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|