这次了解了你的意图了。可以试一下“CreateProcessWithLogonW”或者CreateProcessAsUser函数。(还是要记住用平台调用) 因为我的Windows系统和MSDN都是英文的,所以只贴个英文的帮助信息了。The CreateProcessWithLogonW function creates a new process and its primary thread. The new process then runs the specified executable file in the security context of the specified credentials (user, domain, and password). It can optionally load the user profile for the specified user.The CreateProcessWithLogonW function is similar to the CreateProcessAsUser function, except that the caller does not need to call the LogonUser function to authenticate the user and get a token.
而你想用windows 其它用户的方式执行程序?
因为我的Windows系统和MSDN都是英文的,所以只贴个英文的帮助信息了。The CreateProcessWithLogonW function creates a new process and its primary thread. The new process then runs the specified executable file in the security context of the specified credentials (user, domain, and password). It can optionally load the user profile for the specified user.The CreateProcessWithLogonW function is similar to the CreateProcessAsUser function, except that the caller does not need to call the LogonUser function to authenticate the user and get a token.