Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Run an EXE

Run an EXE

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasetutorial
14 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Eduard Keilholz

    You should be able to run the executable through System.Diagnostics.Process, however you need enough permissions to do this. You may want to run your website in impersonate mode and require a login for your website. I would not recommend this though... Maybe explain us what you want, then someone may come with a better solution?

    .: I love it when a plan comes together :. http://www.zonderpunt.nl

    M Offline
    M Offline
    madancode
    wrote on last edited by
    #5

    HI Eduard, I have tried using System.Diagnostics.Process, but cant able to run in remote system.I just want to run an executable file which would be support for the application.

    1 Reply Last reply
    0
    • M madancode

      My requirement is to run an EXE in remote system. Consider my application is in 'System A' and EXE is in 'System B'. Now i have to run the EXE in System B. How to do this. I am using ASP.Net with C# I am working in this for last two days, still didnt got any solutions. I have already tried with 'System.Diagnostics.Process', I can able to run locally but cant able to run in Remote system. System B is not a client system. Its a separate remote system. Where files be stored. I have just to trigger the EXE their. Any solution/steps/code will be more helpful. Thanks in advance.

      A Offline
      A Offline
      Abhijit Jana
      wrote on last edited by
      #6

      when you want to execute the exe ? after a specific time or after any specific operation ?

      cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

      M 1 Reply Last reply
      0
      • D David Mujica

        This sounds like something that could be solved with a webservice. The webservice could "listen" for things like, start, stop, progress commands. You could then have one machine send these commands to the webservice. Just a suggestion.

        D Offline
        D Offline
        David Mujica
        wrote on last edited by
        #7

        Since you don't have much experience with WebServices, and you speak about System B having files stored. You might find this an interesting approach. The FileSystemWatcher class allows you to monitor a folder for changes and based on some type of change, your application can take action. The idea being that System A could write a small file in a folder that System B is watching. When System B sees the change, it runs whatever logic is necessary. The only thing that you require is that System A can write to a shared folder on System B. Two good articles to show you how this works .. CodeProject: Watching Folder Activity in VB.NET[^] MSDN: FileSystemWatcher Class[^]

        M 1 Reply Last reply
        0
        • M madancode

          My requirement is to run an EXE in remote system. Consider my application is in 'System A' and EXE is in 'System B'. Now i have to run the EXE in System B. How to do this. I am using ASP.Net with C# I am working in this for last two days, still didnt got any solutions. I have already tried with 'System.Diagnostics.Process', I can able to run locally but cant able to run in Remote system. System B is not a client system. Its a separate remote system. Where files be stored. I have just to trigger the EXE their. Any solution/steps/code will be more helpful. Thanks in advance.

          A Offline
          A Offline
          Abhishek Sur
          wrote on last edited by
          #8

          do you have LAN connection from System A and System B...(both servers) If so, pass UNC path to the System.Diagonistic.Process to run the exe with UserId and Password criteria. But Mind that, the process with run in your machine by this process. If you want to run on System B, invoking the process from System A is not possible. You need to find some way say windows service or something that may invoke your process when some action is taken by System A.

          Abhishek Sur My Latest Articles Working with Excel using MDAC
          Basics on LINQ and Lambda Expressions
          Create .NET Templates

          1 Reply Last reply
          0
          • D David Mujica

            Since you don't have much experience with WebServices, and you speak about System B having files stored. You might find this an interesting approach. The FileSystemWatcher class allows you to monitor a folder for changes and based on some type of change, your application can take action. The idea being that System A could write a small file in a folder that System B is watching. When System B sees the change, it runs whatever logic is necessary. The only thing that you require is that System A can write to a shared folder on System B. Two good articles to show you how this works .. CodeProject: Watching Folder Activity in VB.NET[^] MSDN: FileSystemWatcher Class[^]

            M Offline
            M Offline
            madancode
            wrote on last edited by
            #9

            Thanks David. But i think it wont required for my requirement, i just want to execute the exe file on user click event.

            1 Reply Last reply
            0
            • A Abhijit Jana

              when you want to execute the exe ? after a specific time or after any specific operation ?

              cheers, Abhijit CodeProject MVP Web Site:abhijitjana.net View My Recent Article

              M Offline
              M Offline
              madancode
              wrote on last edited by
              #10

              On user click event...

              C 1 Reply Last reply
              0
              • M madancode

                My requirement is to run an EXE in remote system. Consider my application is in 'System A' and EXE is in 'System B'. Now i have to run the EXE in System B. How to do this. I am using ASP.Net with C# I am working in this for last two days, still didnt got any solutions. I have already tried with 'System.Diagnostics.Process', I can able to run locally but cant able to run in Remote system. System B is not a client system. Its a separate remote system. Where files be stored. I have just to trigger the EXE their. Any solution/steps/code will be more helpful. Thanks in advance.

                C Offline
                C Offline
                Christian Graus
                wrote on last edited by
                #11

                Which of these machines is the server for this ASP.NET application ? If B, then it's trivial. If A, then it's not possible, with ASP.NET.

                Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

                M 1 Reply Last reply
                0
                • M madancode

                  On user click event...

                  C Offline
                  C Offline
                  Christian Graus
                  wrote on last edited by
                  #12

                  This is ONLY possible, if machine B is your server, or you have a way of communicating to machine B from the server. Machine B needs to be a webserver of some sort, or on the same network as your server, for this to be possible. You need to provide more information to get your solution, and it may be that you can't do it ( it usually is when people ask how to run an exe, but they usually want to run it on the client )

                  Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

                  1 Reply Last reply
                  0
                  • M madancode

                    Thanks for the suggestion David, can you give me some ideas how can i do it with web services. I am not much familiar with web services.

                    B Offline
                    B Offline
                    Baran M
                    wrote on last edited by
                    #13

                    ya, you can use webservice to run a exe on a remote machine. Write a simple webservice which calls your executable and deploy it on the machine which has the exe. But for that you need to make that machine also as a server.

                    Education is not a way to escape poverty — it is a way of fighting it.

                    1 Reply Last reply
                    0
                    • C Christian Graus

                      Which of these machines is the server for this ASP.NET application ? If B, then it's trivial. If A, then it's not possible, with ASP.NET.

                      Christian Graus Driven to the arms of OSX by Vista. "! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums. I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp

                      M Offline
                      M Offline
                      madancode
                      wrote on last edited by
                      #14

                      System A contains ASP application that's the problem....

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups