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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. how to start command prompt from application

how to start command prompt from application

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
9 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.
  • V Offline
    V Offline
    viral_umang hotmail com
    wrote on last edited by
    #1

    hi! How can i start command prompt from the VC application and how can i give some commands to it. Viral Joshi.

    T 1 Reply Last reply
    0
    • V viral_umang hotmail com

      hi! How can i start command prompt from the VC application and how can i give some commands to it. Viral Joshi.

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

      something like this ?

      ::ShellExecute(NULL, "C:\\a folder\\theApplication.exe", "some params here", NULL, NULL, SW_SHOWNORMAL);

      -- modified at 14:20 Monday 16th April, 2007


      [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

      V 1 Reply Last reply
      0
      • T toxcct

        something like this ?

        ::ShellExecute(NULL, "C:\\a folder\\theApplication.exe", "some params here", NULL, NULL, SW_SHOWNORMAL);

        -- modified at 14:20 Monday 16th April, 2007


        [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

        V Offline
        V Offline
        viral_umang hotmail com
        wrote on last edited by
        #3

        Thanks for the rely i ve tried it with following changed but it doesn't work ::ShellExecute(NULL, "C:\\Program Files\\Microsoft Office\\Office10\\WINWORD.exe ", "C:\\BillPrint\\6.doc", NULL, NULL, SW_SHOWNORMAL); Viral Joshi.

        T 1 Reply Last reply
        0
        • V viral_umang hotmail com

          Thanks for the rely i ve tried it with following changed but it doesn't work ::ShellExecute(NULL, "C:\\Program Files\\Microsoft Office\\Office10\\WINWORD.exe ", "C:\\BillPrint\\6.doc", NULL, NULL, SW_SHOWNORMAL); Viral Joshi.

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

          my bad, i quoted it wrong. change with this :

          ::ShellExecute(NULL,
          _T("open"),
          _T("C:\\Program Files\\Microsoft Office\\Office10\\WINWORD.exe"),
          _T("C:\\BillPrint\\6.doc"),
          NULL,
          SW_SHOWNORMAL);

          or even better, this (if word is the application registered with .doc extension) :

          ::ShellExecute(NULL, _T("open"), _T("C:\\BillPrint\\6.doc"), NULL, NULL, SW_SHOWNORMAL);


          [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

          V 1 Reply Last reply
          0
          • T toxcct

            my bad, i quoted it wrong. change with this :

            ::ShellExecute(NULL,
            _T("open"),
            _T("C:\\Program Files\\Microsoft Office\\Office10\\WINWORD.exe"),
            _T("C:\\BillPrint\\6.doc"),
            NULL,
            SW_SHOWNORMAL);

            or even better, this (if word is the application registered with .doc extension) :

            ::ShellExecute(NULL, _T("open"), _T("C:\\BillPrint\\6.doc"), NULL, NULL, SW_SHOWNORMAL);


            [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

            V Offline
            V Offline
            viral_umang hotmail com
            wrote on last edited by
            #5

            Thanks very much, The code is working fine. I am new to VC++ and supporter like you and codeproject makes me better with every valuable inputs to me. I really appreciate your valuable time you share for improving this community. Viral Joshi.

            T 1 Reply Last reply
            0
            • V viral_umang hotmail com

              Thanks very much, The code is working fine. I am new to VC++ and supporter like you and codeproject makes me better with every valuable inputs to me. I really appreciate your valuable time you share for improving this community. Viral Joshi.

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

              you're welcome. happy to having made your day :cool: ps1: if you found my answer valueable, then don't hesitate to vote for it ;) ps2: it seems that your other question is directly related to this current one, so please delete it


              [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

              M 1 Reply Last reply
              0
              • T toxcct

                you're welcome. happy to having made your day :cool: ps1: if you found my answer valueable, then don't hesitate to vote for it ;) ps2: it seems that your other question is directly related to this current one, so please delete it


                [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

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

                Dude, teach me. How the heck did you figure the OP wanted to launch an app when (s)he asked how to start a command prompt? ;P Are you psychic? What kind of evil forces are at work here? Mark

                "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

                T 1 Reply Last reply
                0
                • M Mark Salsbery

                  Dude, teach me. How the heck did you figure the OP wanted to launch an app when (s)he asked how to start a command prompt? ;P Are you psychic? What kind of evil forces are at work here? Mark

                  "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

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

                  because i read his second (re)post... actually, i answered for launching cmd.exe at first, but i fixed it consequently then :-D anyway, Luke was at home to drink a tea this afternoon, after we practice a Sabro-laser training, so I think a kind of Force is with me... :rolleyes:


                  [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

                  M 1 Reply Last reply
                  0
                  • T toxcct

                    because i read his second (re)post... actually, i answered for launching cmd.exe at first, but i fixed it consequently then :-D anyway, Luke was at home to drink a tea this afternoon, after we practice a Sabro-laser training, so I think a kind of Force is with me... :rolleyes:


                    [VisualCalc][Binary Guide][CommDialogs] | [Forums Guidelines]

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

                    :laugh:

                    "Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

                    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