7 个解决方案
#1
winrar好象有命令行方式,你查一下,如果有命令行方式就可以做到,根据WINRAR的命令行的命令就可以做到,如果没有命令行运行方式,恐怕得截取WINRAR相应菜单命令消息了(用VC自带的SPY软件)
#2
把D:\PNG.RAR解压到d:\png文件夹
C:\Program Files\WinRAR\WinRAR.exe x -iext -ow -ver -- "d:\png.rar" d:\png\
#3
是压缩一个文件夹呀 比如E盘有个叫 PAA的文件夹里面还有子文件夹要把PAA压缩到 F盘
#4
求代码
#5
SetCurrentDirectory(L"C:\\Program Files\\WinRAR\\");
system("WinRAR.exe a F:\\PAA.rar -m5 -s -r E:\\PAA\\*.*");
system("WinRAR.exe a F:\\PAA.rar -m5 -s -r E:\\PAA\\*.*");
#6
/code
CString str="rar a data.rar data.txt";
PROCESS_INFORMATION pidInfo;
STARTUPINFO startInfo;
BOOL b;
char *buf=" ";
startInfo.cb = sizeof(STARTUPINFO);
startInfo.lpReserved = NULL;
startInfo.lpTitle = NULL;
startInfo.lpDesktop = NULL;
startInfo.dwX = 0;
startInfo.dwY = 0;
startInfo.dwXSize = 0;
startInfo.dwYSize = 0;
startInfo.dwXCountChars = 0;
startInfo.dwYCountChars = 0;
startInfo.dwFlags = STARTF_USESTDHANDLES;
startInfo.wShowWindow = 0; //SW_SHOWDEFAULT;
startInfo.lpReserved2 = NULL;
startInfo.cbReserved2 = 0;
startInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
startInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
startInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
b=CreateProcess(NULL,str.GetBuffer(0),NULL,NULL,TRUE,CREATE_NO_WINDOW,NULL,NULL,&startInfo,&pidInfo);
if(!b){
AfxMessageBox("failed");
return;
}
str.ReleaseBuffer();
WaitForSingleObject(pidInfo.hProcess,INFINITE);
CloseHandle(pidInfo.hProcess);
CloseHandle(pidInfo.hThread);
code/
CString str="rar a data.rar data.txt";
PROCESS_INFORMATION pidInfo;
STARTUPINFO startInfo;
BOOL b;
char *buf=" ";
startInfo.cb = sizeof(STARTUPINFO);
startInfo.lpReserved = NULL;
startInfo.lpTitle = NULL;
startInfo.lpDesktop = NULL;
startInfo.dwX = 0;
startInfo.dwY = 0;
startInfo.dwXSize = 0;
startInfo.dwYSize = 0;
startInfo.dwXCountChars = 0;
startInfo.dwYCountChars = 0;
startInfo.dwFlags = STARTF_USESTDHANDLES;
startInfo.wShowWindow = 0; //SW_SHOWDEFAULT;
startInfo.lpReserved2 = NULL;
startInfo.cbReserved2 = 0;
startInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
startInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
startInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
b=CreateProcess(NULL,str.GetBuffer(0),NULL,NULL,TRUE,CREATE_NO_WINDOW,NULL,NULL,&startInfo,&pidInfo);
if(!b){
AfxMessageBox("failed");
return;
}
str.ReleaseBuffer();
WaitForSingleObject(pidInfo.hProcess,INFINITE);
CloseHandle(pidInfo.hProcess);
CloseHandle(pidInfo.hThread);
code/
#7
CString str="rar a data.rar data.txt";
PROCESS_INFORMATION pidInfo;
STARTUPINFO startInfo;
BOOL b;
char *buf=" ";
startInfo.cb = sizeof(STARTUPINFO);
startInfo.lpReserved = NULL;
startInfo.lpTitle = NULL;
startInfo.lpDesktop = NULL;
startInfo.dwX = 0;
startInfo.dwY = 0;
startInfo.dwXSize = 0;
startInfo.dwYSize = 0;
startInfo.dwXCountChars = 0;
startInfo.dwYCountChars = 0;
startInfo.dwFlags = STARTF_USESTDHANDLES;
startInfo.wShowWindow = 0; //SW_SHOWDEFAULT;
startInfo.lpReserved2 = NULL;
startInfo.cbReserved2 = 0;
startInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
startInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
startInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
b=CreateProcess(NULL,str.GetBuffer(0),NULL,NULL,TRUE,CREATE_NO_WINDOW,NULL,NULL,&startInfo,&pidInfo);
if(!b){
AfxMessageBox("failed");
return;
}
str.ReleaseBuffer();
WaitForSingleObject(pidInfo.hProcess,INFINITE);
CloseHandle(pidInfo.hProcess);
CloseHandle(pidInfo.hThread);
#1
winrar好象有命令行方式,你查一下,如果有命令行方式就可以做到,根据WINRAR的命令行的命令就可以做到,如果没有命令行运行方式,恐怕得截取WINRAR相应菜单命令消息了(用VC自带的SPY软件)
#2
把D:\PNG.RAR解压到d:\png文件夹
C:\Program Files\WinRAR\WinRAR.exe x -iext -ow -ver -- "d:\png.rar" d:\png\
#3
是压缩一个文件夹呀 比如E盘有个叫 PAA的文件夹里面还有子文件夹要把PAA压缩到 F盘
#4
求代码
#5
SetCurrentDirectory(L"C:\\Program Files\\WinRAR\\");
system("WinRAR.exe a F:\\PAA.rar -m5 -s -r E:\\PAA\\*.*");
system("WinRAR.exe a F:\\PAA.rar -m5 -s -r E:\\PAA\\*.*");
#6
/code
CString str="rar a data.rar data.txt";
PROCESS_INFORMATION pidInfo;
STARTUPINFO startInfo;
BOOL b;
char *buf=" ";
startInfo.cb = sizeof(STARTUPINFO);
startInfo.lpReserved = NULL;
startInfo.lpTitle = NULL;
startInfo.lpDesktop = NULL;
startInfo.dwX = 0;
startInfo.dwY = 0;
startInfo.dwXSize = 0;
startInfo.dwYSize = 0;
startInfo.dwXCountChars = 0;
startInfo.dwYCountChars = 0;
startInfo.dwFlags = STARTF_USESTDHANDLES;
startInfo.wShowWindow = 0; //SW_SHOWDEFAULT;
startInfo.lpReserved2 = NULL;
startInfo.cbReserved2 = 0;
startInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
startInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
startInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
b=CreateProcess(NULL,str.GetBuffer(0),NULL,NULL,TRUE,CREATE_NO_WINDOW,NULL,NULL,&startInfo,&pidInfo);
if(!b){
AfxMessageBox("failed");
return;
}
str.ReleaseBuffer();
WaitForSingleObject(pidInfo.hProcess,INFINITE);
CloseHandle(pidInfo.hProcess);
CloseHandle(pidInfo.hThread);
code/
CString str="rar a data.rar data.txt";
PROCESS_INFORMATION pidInfo;
STARTUPINFO startInfo;
BOOL b;
char *buf=" ";
startInfo.cb = sizeof(STARTUPINFO);
startInfo.lpReserved = NULL;
startInfo.lpTitle = NULL;
startInfo.lpDesktop = NULL;
startInfo.dwX = 0;
startInfo.dwY = 0;
startInfo.dwXSize = 0;
startInfo.dwYSize = 0;
startInfo.dwXCountChars = 0;
startInfo.dwYCountChars = 0;
startInfo.dwFlags = STARTF_USESTDHANDLES;
startInfo.wShowWindow = 0; //SW_SHOWDEFAULT;
startInfo.lpReserved2 = NULL;
startInfo.cbReserved2 = 0;
startInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
startInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
startInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
b=CreateProcess(NULL,str.GetBuffer(0),NULL,NULL,TRUE,CREATE_NO_WINDOW,NULL,NULL,&startInfo,&pidInfo);
if(!b){
AfxMessageBox("failed");
return;
}
str.ReleaseBuffer();
WaitForSingleObject(pidInfo.hProcess,INFINITE);
CloseHandle(pidInfo.hProcess);
CloseHandle(pidInfo.hThread);
code/
#7
CString str="rar a data.rar data.txt";
PROCESS_INFORMATION pidInfo;
STARTUPINFO startInfo;
BOOL b;
char *buf=" ";
startInfo.cb = sizeof(STARTUPINFO);
startInfo.lpReserved = NULL;
startInfo.lpTitle = NULL;
startInfo.lpDesktop = NULL;
startInfo.dwX = 0;
startInfo.dwY = 0;
startInfo.dwXSize = 0;
startInfo.dwYSize = 0;
startInfo.dwXCountChars = 0;
startInfo.dwYCountChars = 0;
startInfo.dwFlags = STARTF_USESTDHANDLES;
startInfo.wShowWindow = 0; //SW_SHOWDEFAULT;
startInfo.lpReserved2 = NULL;
startInfo.cbReserved2 = 0;
startInfo.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
startInfo.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
startInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
b=CreateProcess(NULL,str.GetBuffer(0),NULL,NULL,TRUE,CREATE_NO_WINDOW,NULL,NULL,&startInfo,&pidInfo);
if(!b){
AfxMessageBox("failed");
return;
}
str.ReleaseBuffer();
WaitForSingleObject(pidInfo.hProcess,INFINITE);
CloseHandle(pidInfo.hProcess);
CloseHandle(pidInfo.hThread);