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. Managed C++/CLI
  4. Run executable with arguments

Run executable with arguments

Scheduled Pinned Locked Moved Managed C++/CLI
question
3 Posts 3 Posters 9 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.
  • E Offline
    E Offline
    Erich Ruth
    wrote on last edited by
    #1

    How can I run this command: pdfcompress.exe "c:\currentfile.pdf" "c:\newfile.pdf" I dont see how I can use ShellExecute to send these 2 arguments. Is there some other command I can use along with these arguments to execute this file? Please let me know.

    L V 2 Replies Last reply
    0
    • E Erich Ruth

      How can I run this command: pdfcompress.exe "c:\currentfile.pdf" "c:\newfile.pdf" I dont see how I can use ShellExecute to send these 2 arguments. Is there some other command I can use along with these arguments to execute this file? Please let me know.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Use the _execl, _wexecl | Microsoft Docs[^] functions which are expressly designed for this.

      1 Reply Last reply
      0
      • E Erich Ruth

        How can I run this command: pdfcompress.exe "c:\currentfile.pdf" "c:\newfile.pdf" I dont see how I can use ShellExecute to send these 2 arguments. Is there some other command I can use along with these arguments to execute this file? Please let me know.

        V Offline
        V Offline
        Victor Nijegorodov
        wrote on last edited by
        #3

        Erich Ruth wrote:

        pdfcompress.exe "c:\currentfile.pdf" "c:\newfile.pdf" I dont see how I can use ShellExecute to send these 2 arguments.

        Have a look at the [ShellExecuteA function (shellapi.h) - Win32 apps | Microsoft Docs](https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea) : its fourth parameter (LPCSTR lpParameters) is what you are looking for.

        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