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. Command for executing files.....

Command for executing files.....

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
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.
  • R Offline
    R Offline
    Ravi Sankar S
    wrote on last edited by
    #1

    Hello All Is there any command in SDK / MFC on passing the file name can execute with appropriate application. For Example command ("a.wav") should open "a.wav" file in Real Player or what user has installed / configured to open the *.WAV files. I can use, WinExec but it needs the executable path to be passed. User can install any type of player and configure different type of file format to open in different players. One Clue is in the Command Prompt if we type the file name it automatically finds the application to be used and opens the file. If the file extension is not mapped with any applicaiton it automatically open the "Open With" dialog box. So I there is any command which executes the string passed as in command line it will do. Is There any command? Thanks for your time Ravi

    T N 2 Replies Last reply
    0
    • R Ravi Sankar S

      Hello All Is there any command in SDK / MFC on passing the file name can execute with appropriate application. For Example command ("a.wav") should open "a.wav" file in Real Player or what user has installed / configured to open the *.WAV files. I can use, WinExec but it needs the executable path to be passed. User can install any type of player and configure different type of file format to open in different players. One Clue is in the Command Prompt if we type the file name it automatically finds the application to be used and opens the file. If the file extension is not mapped with any applicaiton it automatically open the "Open With" dialog box. So I there is any command which executes the string passed as in command line it will do. Is There any command? Thanks for your time Ravi

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      ShellExecute()[^] is the function for you ;)


      TOXCCT >>> GEII power
      [toxcct][VisualCalc]

      1 Reply Last reply
      0
      • R Ravi Sankar S

        Hello All Is there any command in SDK / MFC on passing the file name can execute with appropriate application. For Example command ("a.wav") should open "a.wav" file in Real Player or what user has installed / configured to open the *.WAV files. I can use, WinExec but it needs the executable path to be passed. User can install any type of player and configure different type of file format to open in different players. One Clue is in the Command Prompt if we type the file name it automatically finds the application to be used and opens the file. If the file extension is not mapped with any applicaiton it automatically open the "Open With" dialog box. So I there is any command which executes the string passed as in command line it will do. Is There any command? Thanks for your time Ravi

        N Offline
        N Offline
        Nishad S
        wrote on last edited by
        #3

        Try it: ShellExecute(NULL,"open","a.wav",NULL,"C:\\MyFolder",SW_SHOWNORMAL); or ShellExecute(NULL,"open","C:\\MyFolder\\a.wav",NULL,NULL,SW_SHOWNORMAL);

        R 1 Reply Last reply
        0
        • N Nishad S

          Try it: ShellExecute(NULL,"open","a.wav",NULL,"C:\\MyFolder",SW_SHOWNORMAL); or ShellExecute(NULL,"open","C:\\MyFolder\\a.wav",NULL,NULL,SW_SHOWNORMAL);

          R Offline
          R Offline
          Ravi Sankar S
          wrote on last edited by
          #4

          It is working fine... Thank you all... -Ravi

          T 1 Reply Last reply
          0
          • R Ravi Sankar S

            It is working fine... Thank you all... -Ravi

            T Offline
            T Offline
            toxcct
            wrote on last edited by
            #5

            of course it is... :sigh::~


            TOXCCT >>> GEII power
            [toxcct][VisualCalc]

            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