简体   繁体   English

如何在C ++程序中运行Windows命令?

[英]How to run Windows commands in a C++ program?

Is there a way to put windows commands in C++ program. 有没有办法将Windows命令放在C ++程序中。 I am a newbie so your help will be very much appreciated. 我是新手,所以非常感谢你的帮助。

Thank You 谢谢

You should be able to use the system() function from <cstdlib>7. 您应该能够使用<cstdlib> 7中的system()函数。 Although be aware that it will probably create a cmd.exe window. 虽然请注意它可能会创建一个cmd.exe窗口。 If you don't want that then you can use the windows specific CreateProcess() function. 如果您不想这样,那么您可以使用特定于Windows的CreateProcess()函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM