久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

      <small id='i7Xlg'></small><noframes id='i7Xlg'>

        <bdo id='i7Xlg'></bdo><ul id='i7Xlg'></ul>
      <tfoot id='i7Xlg'></tfoot>

      <legend id='i7Xlg'><style id='i7Xlg'><dir id='i7Xlg'><q id='i7Xlg'></q></dir></style></legend>
      <i id='i7Xlg'><tr id='i7Xlg'><dt id='i7Xlg'><q id='i7Xlg'><span id='i7Xlg'><b id='i7Xlg'><form id='i7Xlg'><ins id='i7Xlg'></ins><ul id='i7Xlg'></ul><sub id='i7Xlg'></sub></form><legend id='i7Xlg'></legend><bdo id='i7Xlg'><pre id='i7Xlg'><center id='i7Xlg'></center></pre></bdo></b><th id='i7Xlg'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='i7Xlg'><tfoot id='i7Xlg'></tfoot><dl id='i7Xlg'><fieldset id='i7Xlg'></fieldset></dl></div>
    1. C++ 執(zhí)行 CMD 命令

      C++ Executing CMD Commands(C++ 執(zhí)行 CMD 命令)
        <tbody id='HXOzX'></tbody>
        <bdo id='HXOzX'></bdo><ul id='HXOzX'></ul>

        <small id='HXOzX'></small><noframes id='HXOzX'>

        1. <i id='HXOzX'><tr id='HXOzX'><dt id='HXOzX'><q id='HXOzX'><span id='HXOzX'><b id='HXOzX'><form id='HXOzX'><ins id='HXOzX'></ins><ul id='HXOzX'></ul><sub id='HXOzX'></sub></form><legend id='HXOzX'></legend><bdo id='HXOzX'><pre id='HXOzX'><center id='HXOzX'></center></pre></bdo></b><th id='HXOzX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='HXOzX'><tfoot id='HXOzX'></tfoot><dl id='HXOzX'><fieldset id='HXOzX'></fieldset></dl></div>
              <tfoot id='HXOzX'></tfoot>

                <legend id='HXOzX'><style id='HXOzX'><dir id='HXOzX'><q id='HXOzX'></q></dir></style></legend>

              • 本文介紹了C++ 執(zhí)行 CMD 命令的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                我在這里遇到了一個嚴(yán)重的問題.我需要通過 C++ 執(zhí)行 CMD 命令行而不顯示控制臺窗口.因此我不能使用 system(cmd),因為窗口會顯示.

                I'm having a serious problem here. I need to execute a CMD command line via C++ without the console window displaying. Therefore I cannot use system(cmd), since the window will display.

                我已經(jīng)嘗試過 winExec(cmd, SW_HIDE),但這也不起作用.CreateProcess 是我嘗試過的另一個.但是,這是用于運行程序或批處理文件.

                I have tried winExec(cmd, SW_HIDE), but this does not work either. CreateProcess is another one I tried. However, this is for running programs or batch files.

                我最終嘗試了 ShellExecute:

                ShellExecute( NULL, "open",
                    "cmd.exe",
                    "ipconfig > myfile.txt",
                    "c:projects",
                    SW_SHOWNORMAL
                );
                

                有人能看出上面的代碼有什么問題嗎?我一直在使用 SW_SHOWNORMAL 直到我知道它有效.

                Can anyone see anything wrong with the above code? I have used SW_SHOWNORMAL until I know this works.

                我真的需要一些幫助.什么都沒有發(fā)現(xiàn),我已經(jīng)嘗試了很長一段時間.任何人都可以提供的任何建議都會很棒:)

                I really need some help with this. Nothing has come to light, and I have been trying for quite a while. Any advice anyone could give would be great :)

                推薦答案

                將輸出重定向到您自己的管道是一個更簡潔的解決方案,因為它避免了創(chuàng)建輸出文件,但這工作正常:

                Redirecting the output to your own pipe is a tidier solution because it avoids creating the output file, but this works fine:

                ShellExecute(0, "open", "cmd.exe", "/C ipconfig > out.txt", 0, SW_HIDE);
                

                您沒有看到 cmd 窗口,并且輸出按預(yù)期重定向.

                You don't see the cmd window and the output is redirected as expected.

                您的代碼可能失敗了(除了 /C 之外),因為您將路徑指定為 "c:projects" 而不是 "c:\projects\b".

                Your code is probably failing (apart from the /C thing) because you specify the path as "c:projects" rather than "c:\projects\b".

                這篇關(guān)于C++ 執(zhí)行 CMD 命令的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                In what ways do C++ exceptions slow down code when there are no exceptions thown?(當(dāng)沒有異常時,C++ 異常會以何種方式減慢代碼速度?)
                Why catch an exception as reference-to-const?(為什么要捕獲異常作為對 const 的引用?)
                When and how should I use exception handling?(我應(yīng)該何時以及如何使用異常處理?)
                Scope of exception object in C++(C++中異常對象的范圍)
                Catching exceptions from a constructor#39;s initializer list(從構(gòu)造函數(shù)的初始化列表中捕獲異常)
                Difference between C++03 throw() specifier C++11 noexcept(C++03 throw() 說明符 C++11 noexcept 之間的區(qū)別)
                <tfoot id='1Myw0'></tfoot>
                  <tbody id='1Myw0'></tbody>

                • <small id='1Myw0'></small><noframes id='1Myw0'>

                    • <i id='1Myw0'><tr id='1Myw0'><dt id='1Myw0'><q id='1Myw0'><span id='1Myw0'><b id='1Myw0'><form id='1Myw0'><ins id='1Myw0'></ins><ul id='1Myw0'></ul><sub id='1Myw0'></sub></form><legend id='1Myw0'></legend><bdo id='1Myw0'><pre id='1Myw0'><center id='1Myw0'></center></pre></bdo></b><th id='1Myw0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1Myw0'><tfoot id='1Myw0'></tfoot><dl id='1Myw0'><fieldset id='1Myw0'></fieldset></dl></div>
                        <legend id='1Myw0'><style id='1Myw0'><dir id='1Myw0'><q id='1Myw0'></q></dir></style></legend>

                        • <bdo id='1Myw0'></bdo><ul id='1Myw0'></ul>
                          主站蜘蛛池模板: 成人免费毛片在线观看 | 欧美精品在线一区二区三区 | 精国产品一区二区三区 | 不卡一区二区三区四区 | 欧美一级淫片免费视频黄 | 天天拍天天色 | 久久一二| 亚洲毛片 | 深夜福利亚洲 | 成人精品久久 | 成人亚洲片 | 国产一级免费视频 | 婷婷色在线播放 | 国产精品久久久乱弄 | 国产成都精品91一区二区三 | 毛片一级片| 国产永久免费 | 成人av电影天堂 | 精品国产1区2区3区 一区二区手机在线 | 在线观看视频一区 | 精品日韩在线 | 正在播放一区二区 | 国产成人av在线 | 国产日韩欧美 | 国产精品免费在线 | 日韩一区在线视频 | 久久久精品| 97精品超碰一区二区三区 | 久久中文字幕av | 久久在线免费 | 亚洲欧美一区二区三区视频 | 国产激情在线 | 久久精品小视频 | 精品国产乱码久久久久久影片 | 综合色影院 | 久久精品久久久久久 | 九九热精品视频在线观看 | 亚洲一区国产 | 视频在线一区二区 | 伊伊综合网 | 午夜天堂精品久久久久 |