MeghaP

Hello friend,

I am using CreateProcessAsUser to start the new process as follow: It is working fine for apllication having .exe extension and showing windows also. (like notepad.exe, control.exe etc)

bool newProcess = Native.Native.CreateProcessAsUser

userToken,

null,

fcp,

ref sa,ref sa,

false,

(int)ProcessCreationFlags.CreateNoWindoe | (int) ProcessPriorityTypes.Normal,

IntPtr.Zero, null,ref si, out pi);

Assume that all this arguments are correct. The problem is here is i m able to create new process with extension .exe. but applications with .msc,.lnk,.cpl (like services.msc,appwiz.cpl etc) are not getting created. Here one more thing is it is returning "true" that process is created but not showing windows for these extension only.

If anyone had this problem or knows where is the problem them please let me know.

Thanks in Advance.

Paresh




Re: Visual C# General CreateProcessAsUser not working for application having .msc, .cpl or .lnk extention....

masaniparesh

Hello Friends,

Some more information regarding above question:

I have also tried following code in place of CreateProcessAsUser:

Process pi = new Process();

pi.StartInfo.FileName = "cmd.exe";

pi.StartInfo.Arguments = " /c " + CommandToRun + " " + CommandArguments;

.

.

.

pi.start();

I experienced that this same code is working in newly created file but not working if replaced at CreateProcessAsUser.

If any one know how it can be possible then please let me know. i will really appreciate it.

Thanks in advance for your help..

Paresh






Re: Visual C# General CreateProcessAsUser not working for application having .msc, .cpl or .lnk extention....

Ji Cheng Wang - MSFT

Hi,

For your concern, I recommend you checking out the remarks for the CreateProcessAsUser function from this document for reference - http://msdn2.microsoft.com/en-us/library/ms682429.aspx

Hope this helps,

Regards,







Re: Visual C# General CreateProcessAsUser not working for application having .msc, .cpl or .lnk extention....

masaniparesh

Thanks Cheng,

I am able to solve the problem all extension other than .lnk.

Paresh






Re: Visual C# General CreateProcessAsUser not working for application having .msc, .cpl or .lnk extention....

Ji Cheng Wang - MSFT

Hi Paresh,

About starting the application with the LNK extension, you can try to follow up this thread - http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=2450479&SiteID=1

Thanks,

Regards,