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 should I call an exe file using C#

How should I call an exe file using C#

Scheduled Pinned Locked Moved C#
csharpquestion
5 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.
  • S Offline
    S Offline
    Saqib Razzaq
    wrote on last edited by
    #1

    I could not find any function in C# that allows to call exe files. I need some function that does the equal of Visual C 6's WinExec (strCommand, nCmdShow). e.g. WinExec ("calc.exe", 0); opens the windows calculator and WinExec ("notepad.exe", 0); opens the notepad. Some same stuff in C# ????

    Y 1 Reply Last reply
    0
    • S Saqib Razzaq

      I could not find any function in C# that allows to call exe files. I need some function that does the equal of Visual C 6's WinExec (strCommand, nCmdShow). e.g. WinExec ("calc.exe", 0); opens the windows calculator and WinExec ("notepad.exe", 0); opens the notepad. Some same stuff in C# ????

      Y Offline
      Y Offline
      Yaron K
      wrote on last edited by
      #2

      Try Exec ? See help.

      S 1 Reply Last reply
      0
      • Y Yaron K

        Try Exec ? See help.

        S Offline
        S Offline
        Saqib Razzaq
        wrote on last edited by
        #3

        I found it in MSDN and ExecCommand (strCommand, strArgs); but I do not know in which namespace they exists. The msdn page that show the description of this method does not tell the namespace requirements. If you know please do let me know.

        J 1 Reply Last reply
        0
        • S Saqib Razzaq

          I found it in MSDN and ExecCommand (strCommand, strArgs); but I do not know in which namespace they exists. The msdn page that show the description of this method does not tell the namespace requirements. If you know please do let me know.

          J Offline
          J Offline
          Juergen Posny
          wrote on last edited by
          #4

          Exec is an internal method within the visual studio ide. For generic tasks, you should try the 'Process' object. You can find it in the 'System.Diagnostics' namespace. ex : Process.Start("IExplore.exe", "www.northwindtraders.com");

          S 1 Reply Last reply
          0
          • J Juergen Posny

            Exec is an internal method within the visual studio ide. For generic tasks, you should try the 'Process' object. You can find it in the 'System.Diagnostics' namespace. ex : Process.Start("IExplore.exe", "www.northwindtraders.com");

            S Offline
            S Offline
            Saqib Razzaq
            wrote on last edited by
            #5

            Thanks alot. it solved my 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