How to call CMD without opening a window

后端 未结 7 727
被撕碎了的回忆
被撕碎了的回忆 2021-01-03 20:18

I\'ve an C++ method (using Visual Studio, if it helps) that calls to cmd like this:

start \\B example.exe arg1 arg2 arg3

The problem is tha

7条回答
  •  猫巷女王i
    2021-01-03 21:14

    I dont know how to do it in C++ but to open a new command prompt window that is also minimized (or "hidden") using a batch file i would use:

    start /min cmd
    

    Or if you start the command prompt you can type:

    @echo off
    cls && start /b cmd
    

    This restarts the current command prompt window with out closing it, however all previously set environment variables are reset. Hope this helps!

    (PS. This was tested and was successful on Windows 7 Ultimate OS)

提交回复
热议问题