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 dos command

executing dos command

Scheduled Pinned Locked Moved C / C++ / MFC
debugging
5 Posts 5 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.
  • S Offline
    S Offline
    Shay Harel
    wrote on last edited by
    #1

    Hi, I want to execute a DOS command line from my code The funny thing is when I use: WinExec("CMD.EXE /C .......") I will not work from the code but when I use the same exact command manually from a dods window it works great. I even followed the debugger and copy and paster the stuff it sends to the dos but nothing, I always end up with the DOS window flashing for a second a then it's gone/ Shay

    V C C T 4 Replies Last reply
    0
    • S Shay Harel

      Hi, I want to execute a DOS command line from my code The funny thing is when I use: WinExec("CMD.EXE /C .......") I will not work from the code but when I use the same exact command manually from a dods window it works great. I even followed the debugger and copy and paster the stuff it sends to the dos but nothing, I always end up with the DOS window flashing for a second a then it's gone/ Shay

      V Offline
      V Offline
      valikac
      wrote on last edited by
      #2

      One solution is ShellExecute(). ShellExecute(..."open", "cmd.exe"...); Kuphryn

      1 Reply Last reply
      0
      • S Shay Harel

        Hi, I want to execute a DOS command line from my code The funny thing is when I use: WinExec("CMD.EXE /C .......") I will not work from the code but when I use the same exact command manually from a dods window it works great. I even followed the debugger and copy and paster the stuff it sends to the dos but nothing, I always end up with the DOS window flashing for a second a then it's gone/ Shay

        C Offline
        C Offline
        Chris Losinger
        wrote on last edited by
        #3

        use "system(...)" -c


        Image tools: ThumbNailer, Bobber, TIFFAssembler

        1 Reply Last reply
        0
        • S Shay Harel

          Hi, I want to execute a DOS command line from my code The funny thing is when I use: WinExec("CMD.EXE /C .......") I will not work from the code but when I use the same exact command manually from a dods window it works great. I even followed the debugger and copy and paster the stuff it sends to the dos but nothing, I always end up with the DOS window flashing for a second a then it's gone/ Shay

          C Offline
          C Offline
          converdb
          wrote on last edited by
          #4

          Let's try with this one: WINSHELLAPI BOOL WINAPI ShellExecuteEx( LPSHELLEXECUTEINFO lpExecInfo ); Just three words: void main(void)

          1 Reply Last reply
          0
          • S Shay Harel

            Hi, I want to execute a DOS command line from my code The funny thing is when I use: WinExec("CMD.EXE /C .......") I will not work from the code but when I use the same exact command manually from a dods window it works great. I even followed the debugger and copy and paster the stuff it sends to the dos but nothing, I always end up with the DOS window flashing for a second a then it's gone/ Shay

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

            create a batch file ! execute_com.bat open it write commands line by line ! and winexec it ! :) cool ah //rate me or hate me I am the mighty keeper of the book on knowledge . Contact me to get your copy .

            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