Click here to Skip to main content
15,896,526 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
Hi..

I am developing an application where I need to open an .exe, which is on remote computer.

Can anyone please suggest me how to do this.

i tried opening .exe on local machine..and its working fine.

here is the code for that..!!
C#
Process myProcess = new Process();
             myProcess.StartInfo.UseShellExecute = false;
            myProcess.StartInfo.FileName = @"C:WindowsFormsApplication2\bin\Debug\WindowsFormsApplication2.exe";
            myProcess.Start();


What I have tried:

I created windows application and I want to open .exe file on remote computer using a button click.
Posted
Updated 31-May-16 5:53am
Comments
Philippe Mori 25-May-16 19:55pm    
Stop writing spam software. We do not need such software.

The short answer is you can't, for rather obvious security reasons.

You CAN launch an .EXE on a remote machine only if you have admin access to the remote machine AND it is NOT a user interactive process. The user on the remote machine will NEVER see the UI.
 
Share this answer
 
Comments
Member 12478311 25-May-16 12:41pm    
I have admin access..!!
Dave Kreskowiak 25-May-16 12:42pm    
So what? The user on that machine will NEVER see if running. This is to prevent someone from compromising security and getting a malicious .EXE running on the client that asks for users credentials.
Dave Kreskowiak 25-May-16 12:43pm    
Oh, and the Process class cannot be used to do it. It must be done through WMI and the "Win32_Process" class.
Member 12478311 25-May-16 12:44pm    
I have .exe file on remote machine..
and I want to open it from my machine with a button click..
Dave Kreskowiak 25-May-16 12:46pm    
Yeah, and? I already told you why this is not going to happen.
I got it working..and I did it by adding ProcessExtensions.cs to my service, and opened the .exe with service.

Thought that this may be useful to someone :)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900