文件在cpp中执行 [英] File executing in cpp

查看:82
本文介绍了文件在cpp中执行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从cpp代码执行.bat文件。任何人都可以建议我从Windows 32中的代码运行.bat文件的代码。

I want to execute .bat file from the cpp code. Can any one suggest me the code to run .bat file from the code in windows 32.

推荐答案

从<$ c $启动另一个可执行文件的方法有很多种c> Windows 应用程序:

There are many ways for starting another executable from a Windows application:
  • The CRT system[^] call.
  • The WINAPI CreateProcess[^] function.
  • the ShellExecute[^] function.


不到一分钟的谷歌搜索发现我这个:

http://www.cplusplus.com/reference/cstdlib/system/ [ ^ ]
Less than a minute of googling found me this:
http://www.cplusplus.com/reference/cstdlib/system/[^]

您可以使用 ShellExecute [ ^ ]如果在Windows中
You can use ShellExecute[^] if in Windows


这篇关于文件在cpp中执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆