怎么用C语言实现运行某个程序
怎么用C来运行某个程序比如想运行QQ
是用SYSTEM吗?
#include<stdio.h>
#include<stdlib.h>
int main()
{
system("c:\\program files\\tencent\\qq\\qq.exe");
}
这好象不能实现,怎么弄??
帮帮忙````急~``
#include <windows.h>
int main(int argc, char*arcv[])
{
char szFileName[] = "C:\\program files\\tencent\\qq\\qq.exe";
STARTUPINFO si = { sizeof(si) };
PROCESS_INFORMATION pi;
::CreateProcess(NULL, szFileName, NULL, NULL, FALSE, CREATE_NEW_CONSOLE, NULL, NULL, &si, &pi);
::CloseHandle(pi.hThread);
return 0;
}