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. General Programming
  3. C#
  4. Run external exe in C#

Run external exe in C#

Scheduled Pinned Locked Moved C#
csharpquestion
8 Posts 3 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.
  • P Offline
    P Offline
    Piyush Vaishnav
    wrote on last edited by
    #1

    hi guys, I want to run any C# made exe from another C# program. For that i used this code: System.Diagnostics.Process.Start(exe path); It's working fine. But when i am using same code in OnStart() method of Windows Services. It will start the process into Task Manager Processes, but not showing in screen whatever GUI that exe has. To show GUI also , what should i do? Thanks....

    L G 2 Replies Last reply
    0
    • P Piyush Vaishnav

      hi guys, I want to run any C# made exe from another C# program. For that i used this code: System.Diagnostics.Process.Start(exe path); It's working fine. But when i am using same code in OnStart() method of Windows Services. It will start the process into Task Manager Processes, but not showing in screen whatever GUI that exe has. To show GUI also , what should i do? Thanks....

      G Offline
      G Offline
      Giorgi Dalakishvili
      wrote on last edited by
      #2

      As services run under on different desktop, the application is running but it's gui is displayed on different desktop, that's why you can't see it. If you want to see GUI you will have to run process ob behalf of the user that is logged in. If you want to have GUI for your service, just create new winforms application. To communicate between GUI and service you can use IPC or .NET Remoting.

      Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion

      1 Reply Last reply
      0
      • P Piyush Vaishnav

        hi guys, I want to run any C# made exe from another C# program. For that i used this code: System.Diagnostics.Process.Start(exe path); It's working fine. But when i am using same code in OnStart() method of Windows Services. It will start the process into Task Manager Processes, but not showing in screen whatever GUI that exe has. To show GUI also , what should i do? Thanks....

        L Offline
        L Offline
        leppie
        wrote on last edited by
        #3

        You need to manually set the 'Allow service to interact with Desktop' to on. Did you think how this will work when the PC starts, and no-one is logged in?

        xacc.ide - now with TabsToSpaces support
        IronScheme - 1.0 beta 1 - coming soon
        ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

        G P 3 Replies Last reply
        0
        • L leppie

          You need to manually set the 'Allow service to interact with Desktop' to on. Did you think how this will work when the PC starts, and no-one is logged in?

          xacc.ide - now with TabsToSpaces support
          IronScheme - 1.0 beta 1 - coming soon
          ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

          G Offline
          G Offline
          Giorgi Dalakishvili
          wrote on last edited by
          #4

          leppie wrote:

          You need to manually set the 'Allow service to interact with Desktop' to on.

          But it is no more supported in Vista.

          Giorgi Dalakishvili #region signature My Articles / My Latest Article[^] / My blog[^] #endregion

          1 Reply Last reply
          0
          • L leppie

            You need to manually set the 'Allow service to interact with Desktop' to on. Did you think how this will work when the PC starts, and no-one is logged in?

            xacc.ide - now with TabsToSpaces support
            IronScheme - 1.0 beta 1 - coming soon
            ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

            P Offline
            P Offline
            Piyush Vaishnav
            wrote on last edited by
            #5

            Thanks .........It's working now.....

            1 Reply Last reply
            0
            • L leppie

              You need to manually set the 'Allow service to interact with Desktop' to on. Did you think how this will work when the PC starts, and no-one is logged in?

              xacc.ide - now with TabsToSpaces support
              IronScheme - 1.0 beta 1 - coming soon
              ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

              P Offline
              P Offline
              Piyush Vaishnav
              wrote on last edited by
              #6

              hi......leppie..... Now it's working fine. But i want to set this property programmatically. Is it possible? Thanks......

              L 1 Reply Last reply
              0
              • P Piyush Vaishnav

                hi......leppie..... Now it's working fine. But i want to set this property programmatically. Is it possible? Thanks......

                L Offline
                L Offline
                leppie
                wrote on last edited by
                #7

                No you cant, as said, this is apparently not even possible on Vista.

                xacc.ide - now with TabsToSpaces support
                IronScheme - 1.0 beta 1 - coming soon
                ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

                P 1 Reply Last reply
                0
                • L leppie

                  No you cant, as said, this is apparently not even possible on Vista.

                  xacc.ide - now with TabsToSpaces support
                  IronScheme - 1.0 beta 1 - coming soon
                  ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))

                  P Offline
                  P Offline
                  Piyush Vaishnav
                  wrote on last edited by
                  #8

                  ok.......Thanks...

                  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