Asked by:

CreateProcessAsUser

Question

I am trying to accomplish a windows service which creates a process
using createprocessasuser.I went through the internet for 2 months but
never got a working code in windows 2000.Can anybody give me a working
solution that run an interactive process in console(winsta0/default).

This is the code I am using.But unfortunately its getting a windows error Application failed to initialize.When we commenting the code Si.Desktop="winsta0/default" then we haven't any error and we can see the process started in Task Manager but cant see window in this desktop (Its Started in another desktop .I want to start in console).What I did wrong ? Whats wrong with this code? And I am using windows 2000 so cant use WTSGetActiveConsoleSessionId() and WTSQueryUserToken().Can anybody help me?