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 access command prompt ?

How to access command prompt ?

Scheduled Pinned Locked Moved C / C++ / MFC
jsontutorialquestion
6 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.
  • N Offline
    N Offline
    Nikhil Trivedi
    wrote on last edited by
    #1

    Dear all, Can anyone tell me if there is any API for accessing command prompt and get the result of the command back to the application ? Thanks for your prompt reply. Nikhs Nikhil Trivedi

    T 1 Reply Last reply
    0
    • N Nikhil Trivedi

      Dear all, Can anyone tell me if there is any API for accessing command prompt and get the result of the command back to the application ? Thanks for your prompt reply. Nikhs Nikhil Trivedi

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

      Nikhil Trivedi wrote:

      accessing command prompt

      Search CP[^]

      "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

      cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you

      N 1 Reply Last reply
      0
      • T ThatsAlok

        Nikhil Trivedi wrote:

        accessing command prompt

        Search CP[^]

        "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

        cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and you

        N Offline
        N Offline
        Nikhil Trivedi
        wrote on last edited by
        #3

        ThatsAlok wrote:

        Search CP[^]

        Thanks Dear. But I want to send commands from my application and have the result back to the application like if I want to use the netsend command then how can I using visual C++ ? Nikhs Nikhil Trivedi

        P 1 Reply Last reply
        0
        • N Nikhil Trivedi

          ThatsAlok wrote:

          Search CP[^]

          Thanks Dear. But I want to send commands from my application and have the result back to the application like if I want to use the netsend command then how can I using visual C++ ? Nikhs Nikhil Trivedi

          P Offline
          P Offline
          prasad_som
          wrote on last edited by
          #4

          Nikhil Trivedi wrote:

          if I want to use the netsend command then how can I using visual C++ ?

          You should use corresponding socket API's, instead of following this approach. However, you can refer Console functions[^], and see what fits your needs.


          Prasad MS MVP -  VC++

          N 1 Reply Last reply
          0
          • P prasad_som

            Nikhil Trivedi wrote:

            if I want to use the netsend command then how can I using visual C++ ?

            You should use corresponding socket API's, instead of following this approach. However, you can refer Console functions[^], and see what fits your needs.


            Prasad MS MVP -  VC++

            N Offline
            N Offline
            Nikhil Trivedi
            wrote on last edited by
            #5

            Thanks for your reply. But actually I used the netsend command for example purpose only. I want to use some commands like cd directory, cd.., and run some .exe from console. Can you help me in that ? Thanks for your prompt reply. Nikhs Nikhil Trivedi

            P 1 Reply Last reply
            0
            • N Nikhil Trivedi

              Thanks for your reply. But actually I used the netsend command for example purpose only. I want to use some commands like cd directory, cd.., and run some .exe from console. Can you help me in that ? Thanks for your prompt reply. Nikhs Nikhil Trivedi

              P Offline
              P Offline
              prasad_som
              wrote on last edited by
              #6

              Nikhil Trivedi wrote:

              I want to use some commands like cd directory

              There is equivalent of very command you like to run from command prompt. You can use CreateDirectory in this case.

              Nikhil Trivedi wrote:

              and run some .exe from console.

              You can use ShellExecure, CreateProcess for this purpose. Refer its documentation.


              Prasad MS MVP -  VC++

              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