您的位置:首页 > 其它

windows用bat命令启动程序并传递参数

2014-10-16 16:13 597 查看
转载自:http://blog.csdn.net/xgx198831/article/details/8828653

</pre><pre name="code" class="cpp">// ================================= 接收参数程序
<p>#include "stdafx.h"
#include <tchar.h>
//#include <winbase.h>
#include <windows.h></p><p>int main(int argc, char* argv[])
{
 char szCommand[64]={0};
 char *pStr = szCommand;
 pStr = GetCommandLine();
 printf("Hello World!\n");
 printf("command.......... : %s\n", pStr);</p><p> getchar();
 return 0;
}</p><p> </p><p>// ======================= bat 文件
echo off
start batParam.exe innnnnnnnnnnnnnnnnnnnnnn</p><p> </p><p>// ================================= 运行结果</p><p>Hello World!
command.......... : batParam.exe  innnnnnnnnnnnnnnnnnnnnnn</p>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: