📄 install.cpp
字号:
// Install.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "windows.h"
#include "stdlib.h"
int main(int argc, char* argv[])
{
//printf("Hello World!\n");
char dir[260],str[260];
char *szProgExe,*commline,*sourFile,*targFile;
BOOL result;
DWORD error;
STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInformation;
szProgExe=(char *)calloc(260,sizeof(char));
commline=(char *)calloc(260,sizeof(char));
sourFile=(char *)calloc(260,sizeof(char));
targFile=(char *)calloc(260,sizeof(char));
error=GetCurrentDirectory(
260, // size of directory buffer
dir // directory buffer
);
GetSystemDirectory(
szProgExe, // address of buffer for system directory
260 // size of directory buffer
);
//Copy windrvr6.sys
sprintf(targFile,"%s\\drivers\\windrvr6.sys",szProgExe);
sprintf(sourFile,"%s\\%s",dir,"windrvr6.sys");
CopyFile(
sourFile,
targFile, // pointer to filename to copy to
false // flag for operation if file exists
);
//Exe windrvr6.inf
sprintf(str,"%s%s",dir,"\\windrvr6.inf");
sprintf(szProgExe,"%s\\%s",dir,"wdreg.exe");
sprintf(commline,"-inf %s\\%s Install\0",dir,"windrvr6.inf");
ZeroMemory(&StartupInfo, sizeof(STARTUPINFO));
StartupInfo.cb = sizeof(STARTUPINFO);
StartupInfo.wShowWindow = SW_NORMAL;
ZeroMemory(&ProcessInformation, sizeof(PROCESS_INFORMATION));
sprintf(str,"%s %s\0",szProgExe,commline);
WinExec(
str, // command line
0 // window style
);
Sleep(2000);
//Exe stp03.inf
sprintf(str,"%s%s",dir,"\\stp03.inf");
sprintf(szProgExe,"%s\\%s",dir,"wdreg.exe");
sprintf(commline,"-inf %s\\%s Install\0",dir,"stp03.inf");
ZeroMemory(&StartupInfo, sizeof(STARTUPINFO));
StartupInfo.cb = sizeof(STARTUPINFO);
StartupInfo.wShowWindow = SW_NORMAL;
ZeroMemory(&ProcessInformation, sizeof(PROCESS_INFORMATION));
sprintf(str,"%s %s\0",szProgExe,commline);
WinExec(
str, // command line
0 // window style
);
Sleep(2000);
free(szProgExe);
free(commline);
free(sourFile) ;
free(targFile);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -