Click here to Skip to main content
15,893,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have an Exe application file and i want to run file over internet in direct execute mode
C#
try
      {
          // Create An instance of the Process class responsible for starting the newly process.
          System.Diagnostics.Process process1 = new System.Diagnostics.Process();
          // Set the filename name of the file you want to execute/open
          process1.StartInfo.FileName = @"d:\Applications\\\\\.exe";
          process1.StartInfo.Arguments = "args";

          // Start the process without blocking the current thread
          process1.Start();
          // you may wait until finish that executable
          process1.WaitForExit();
          //or you can wait for a certain time interval
          //Thread.Sleep(20000);//Assume within 20 seconds it will finish processing.
          process1.Close();
      }
      catch (Exception ex)




This process works fine in visual studio but when i add project to iis its not working file not opening no error found ..... i want to know that iis allow to execute exe file or not......or any other idea to run exe application over internet ...pls help...
thanks in advance
Posted
Comments
_Asif_ 4-Feb-15 3:11am    
Adding logging using Log4Net and then see what exception you are getting if any. Secondly have you given a thought over how client side machine will be able to find the exe which you like to execute on client machine (if i understood correctly!)

1. You can't run that app on the client, meaning you can't have someone browse to your site and have that app run on their machine. That would be a major security risk.
2. Doing what you are doing will try to run the exe on your IIS server. If that is what you want then you just need to grant the proper permissions to the user running the IIS Application Pool.
 
Share this answer
 
Comments
TheRealSteveJudge 4-Feb-15 8:50am    
5*
An application running in IIS
runs with a so-called Application-Pool Identity.
This is the default.

Therefore the application hosted in IIS cannot access your applications folder.

Please read:
http://www.iis.net/learn/manage/configuring-security/application-pool-identities[^]

If your application pool is "DefaultAppPool"
you must assign rights to user "IIS AppPool\DefaultAppPool"
to access your applications folder.

Besides: What you are trying to do is dangerous as solution 1 already told you.
 
Share this answer
 

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