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. Executing an exe

Executing an exe

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
3 Posts 2 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.
  • U Offline
    U Offline
    User 11731824
    wrote on last edited by
    #1

    Hi all, I have somewhat simple DOS command line, but I can't get it to work. Here is my code: // the line to be executed: // c:\a\wzzip c:\b\b.zip c:\b\*.* // my first try, it return "The specified file was not found." ShellExecute(NULL, "open", "C:\\a\\wzzip C:\\b\\b.zip C:\\b\\*.*", NULL, NULL, SW_SHOWNORMAL); //my second try WinExec ("c:\\a\\wzzip c:\\b\\b.zip c:\\b\\*.*", SW_SHOW); //my third try _spawnl( _P_WAIT, "C:\\a\\wzzip C:\\b\\b.zip C:\\b\\*.*", "C:\\a\\wzzip C:\\b\\b.zip C:\\b\\*.*", NULL, NULL, NULL); Can anyone please help me? Thanks a lot.

    G 1 Reply Last reply
    0
    • U User 11731824

      Hi all, I have somewhat simple DOS command line, but I can't get it to work. Here is my code: // the line to be executed: // c:\a\wzzip c:\b\b.zip c:\b\*.* // my first try, it return "The specified file was not found." ShellExecute(NULL, "open", "C:\\a\\wzzip C:\\b\\b.zip C:\\b\\*.*", NULL, NULL, SW_SHOWNORMAL); //my second try WinExec ("c:\\a\\wzzip c:\\b\\b.zip c:\\b\\*.*", SW_SHOW); //my third try _spawnl( _P_WAIT, "C:\\a\\wzzip C:\\b\\b.zip C:\\b\\*.*", "C:\\a\\wzzip C:\\b\\b.zip C:\\b\\*.*", NULL, NULL, NULL); Can anyone please help me? Thanks a lot.

      G Offline
      G Offline
      GeVanCo
      wrote on last edited by
      #2

      Hi, Why not trying the 'system' command? I've done it already a few times to execute a Dos command like you would give it on the command line, and this works fine. Give it a try? Best regards, Geert

      U 1 Reply Last reply
      0
      • G GeVanCo

        Hi, Why not trying the 'system' command? I've done it already a few times to execute a Dos command like you would give it on the command line, and this works fine. Give it a try? Best regards, Geert

        U Offline
        U Offline
        User 11731824
        wrote on last edited by
        #3

        Thank you very much Geert :) It works wonderfully!

        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