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 / C++ / MFC
  4. How to launch exe file with command line?

How to launch exe file with command line?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialc++question
4 Posts 4 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.
  • J Offline
    J Offline
    jerome_data
    wrote on last edited by
    #1

    I used Win32 and MFC. I try launch exe file with commands line. How to this? example: "c:\dir1\form.exe cmd1" thanks

    M H J 3 Replies Last reply
    0
    • J jerome_data

      I used Win32 and MFC. I try launch exe file with commands line. How to this? example: "c:\dir1\form.exe cmd1" thanks

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Assuming you want to do this programmatically, you could use the CreateProcess() API - check out the first two parameters. There's more useful info at Michael Dunn's MFC FAQs[^] Mark

      Mark Salsbery Microsoft MVP - Visual C++ :java:

      1 Reply Last reply
      0
      • J jerome_data

        I used Win32 and MFC. I try launch exe file with commands line. How to this? example: "c:\dir1\form.exe cmd1" thanks

        H Offline
        H Offline
        Hamid Taebi
        wrote on last edited by
        #3

        Does ShellExecute helpful?

        1 Reply Last reply
        0
        • J jerome_data

          I used Win32 and MFC. I try launch exe file with commands line. How to this? example: "c:\dir1\form.exe cmd1" thanks

          J Offline
          J Offline
          Jason Teagle
          wrote on last edited by
          #4

          Take a look at ShellExecuteEx() in MSDN. (Hint: you need the _T("open") verb.)

          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