0

I got a web site with a link called 'Open Trim' which should open an application on local PC called Trim.exe. When I run the website on my local PC it works fine. I click the link 'Open Trim' and the Trim.exe application opens. But, when I upload the same code to the Windows 2003 server the link doesn't do anything.

I have seen in github.com website where you could open a GitHub desktop application by clicking the link 'Clone in Desktop'. I am trying to achieve similar feature with my website and Trim.exe.

enter image description here

I am using the following code.

        var p = new Process
            {
               StartInfo = {
                        UseShellExecute = false,
                        RedirectStandardOutput = true,
                        FileName = path + openTrimBatchFileName
                    }
            };
        p.Start();
        p.StandardOutput.ReadToEnd();
        p.StartInfo.CreateNoWindow = true;
        p.WaitForExit();

Reference: how run exe file in c#

Community
  • 1
  • 1
Diganta Kumar
  • 3,637
  • 3
  • 27
  • 29
  • Your user has to download the EXE and execute it, if they want it to run on their machine. – Robert Harvey Aug 09 '13 at 04:25
  • I think it does exactly what you ask from it. It would start the application on the same device that that code is executed on. I.E the server. Whatyou want is, the server to execute an application on the client, right? – Joey Roosing Aug 09 '13 at 04:32
  • @RobertHarvey I have update the question as requested. – Diganta Kumar Aug 12 '13 at 00:14
  • `Clone in Desktop` works by the desktop app installing a URL handler. The browser doesn't run arbitrary code on the client computer, it just hands the URL over to an already installed app. – millimoose Aug 12 '13 at 00:24
  • @JoeyRoosing yes I want the server to execute an application on the client PC. How? – Diganta Kumar Aug 12 '13 at 01:00
  • By giving your clients a link to the .EXE, so they can run it themselves. There is no other way. – Robert Harvey Aug 12 '13 at 03:00

1 Answers1

2

The code you mentioned will make the exe to run on server machine. That's why it is working on your local PC. Your client machine would have to download the exe than have to run on their machine. SO instead of this code, you have to give the link so that users can download the exe and then run it.

Paritosh
  • 11,144
  • 5
  • 56
  • 74