how can we use a batch file in c++?

前端 未结 6 2165
一整个雨季
一整个雨季 2020-12-15 09:36

MY PURPOSE: I want to make a c++ program that could use DOS commands.

OPTION: I can make a batch file and put into it the DOS commands. But I don\'t know how

6条回答
  •  青春惊慌失措
    2020-12-15 09:47

    Putting dos commands inside batch script seems like a good idea. Then you can of course use system command.

    But if your C++ program also needs stdout of the batch script you were running, you should try: _popen or _wpopen.

    For more info and code sample visit MSDN.

提交回复
热议问题