c++创建进程执行文件

// ConsoleApplication3.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"
#include 
#include 
#include
#include

using namespace std;



int _tmain(int argc, _TCHAR* argv[])
{


	wstring szCmdLine = L"E:\\svn\\备份\\cefclient\\Release\\安装包\\科学阅读器 Setup.exe";
	//wstring szCmdLine = L"C:\\Users\\Jin\\Documents\\Visual Studio 2013\\Projects\\Win32Project2\\Debug\\Win32Project2.exe";
	STARTUPINFO si = { sizeof(si) };
	PROCESS_INFORMATION pi;
	si.wShowWindow = 1;
	//si.dwFlags = STARTF_USESHOWWINDOW;
	BOOL ret = ::CreateProcessW(
		NULL,
		&szCmdLine[0],
		NULL,
		NULL,
		0,
		0,
		NULL,
		NULL,
		&si,
		&pi);
	if(ret)
{
    ::CloseHandle(pi.hProcess);
    ::CloseHandle(pi.hThread);
    std::cout<<"新进程的id:"<

你可能感兴趣的:(c++)