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. How do i open a program from a button

How do i open a program from a button

Scheduled Pinned Locked Moved C#
question
9 Posts 4 Posters 2 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.
  • C Offline
    C Offline
    C Beginner Nick
    wrote on last edited by
    #1

    How do i open a program (.exe) from a button on another program?

    R 1 Reply Last reply
    0
    • C C Beginner Nick

      How do i open a program (.exe) from a button on another program?

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      See Process.Start()[^]. /ravi

      This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

      C 1 Reply Last reply
      0
      • R Ravi Bhavnani

        See Process.Start()[^]. /ravi

        This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

        C Offline
        C Offline
        C Beginner Nick
        wrote on last edited by
        #3

        Sorry ravi, that didn't help at all. I tried it, gave me a bunch of different error's Error 3 Unrecognized escape sequence

        R M 2 Replies Last reply
        0
        • C C Beginner Nick

          Sorry ravi, that didn't help at all. I tried it, gave me a bunch of different error's Error 3 Unrecognized escape sequence

          R Offline
          R Offline
          Ravi Bhavnani
          wrote on last edited by
          #4

          You probably forgot to escape the application filespec. Instead of:

          Process.Start ("C:\MyProg.exe");

          use one of these options:

          Process.Start ("C:\\MyProg.exe");
          Process.Start (@"C:\MyProg.exe");

          /ravi

          This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

          C 1 Reply Last reply
          0
          • C C Beginner Nick

            Sorry ravi, that didn't help at all. I tried it, gave me a bunch of different error's Error 3 Unrecognized escape sequence

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

            Well, without the source code, I would hazard a guess and say that you're not double-back-slashing your constant string like this: "C:\\Program Files\\Some Program Folder\\SomeExe.exe" Am I "write"? Of course, if this IS the case, I would suggest reading a little bit in a "learn to code in C in 21 days" or C# for dummies book... If I am wrong, well, try posting some source code o we can see what you're doing wrong.

            R 1 Reply Last reply
            0
            • M macerenn

              Well, without the source code, I would hazard a guess and say that you're not double-back-slashing your constant string like this: "C:\\Program Files\\Some Program Folder\\SomeExe.exe" Am I "write"? Of course, if this IS the case, I would suggest reading a little bit in a "learn to code in C in 21 days" or C# for dummies book... If I am wrong, well, try posting some source code o we can see what you're doing wrong.

              R Offline
              R Offline
              Ravi Bhavnani
              wrote on last edited by
              #6

              macerenn wrote:

              Am I "write"?

              Ouch! <rolls over and gropes in the dark for a ham sandwich...> /ravi

              This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

              R 1 Reply Last reply
              0
              • R Ravi Bhavnani

                You probably forgot to escape the application filespec. Instead of:

                Process.Start ("C:\MyProg.exe");

                use one of these options:

                Process.Start ("C:\\MyProg.exe");
                Process.Start (@"C:\MyProg.exe");

                /ravi

                This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

                C Offline
                C Offline
                C Beginner Nick
                wrote on last edited by
                #7

                Ya, there it is. That and i forgot to put in the System.Diagnostics; Thank you ravi

                1 Reply Last reply
                0
                • R Ravi Bhavnani

                  macerenn wrote:

                  Am I "write"?

                  Ouch! <rolls over and gropes in the dark for a ham sandwich...> /ravi

                  This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

                  R Offline
                  R Offline
                  Rich Insley
                  wrote on last edited by
                  #8

                  Ravi Bhavnani wrote:

                  Am I "write"?

                  Looks like Cobol. Perhaps FileStream.CanWrite would work better :)

                  R 1 Reply Last reply
                  0
                  • R Rich Insley

                    Ravi Bhavnani wrote:

                    Am I "write"?

                    Looks like Cobol. Perhaps FileStream.CanWrite would work better :)

                    R Offline
                    R Offline
                    Ravi Bhavnani
                    wrote on last edited by
                    #9

                    JohnnyLocust wrote:

                    Looks like Cobol.

                    Mmmm... Cobol! :cool: /ravi

                    This is your brain on Celcius Home | Music | Articles | Freeware | Trips ravib(at)ravib(dot)com

                    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