【发布时间】:2015-07-15 08:34:18
【问题描述】:
我想使用 c 编程使用 winzip 命令行解压缩文件,我编写了以下代码,但执行后显示 system 命令无法识别内部或外部命令
#include <stdio.h>
#include <stdlib.h>
#include<conio.h>
#include <string.h>
void fmuUnzip() {
char fmuFileName[100], path[100],strFinal[100];
char unzip[512]="wzunzip";
printf("Enter fmuFileName\n");
gets(fmuFileName);
printf("Enter path of the fmuFileName\n");
gets(path);
strcat(unzip," ");
strcat(unzip,fmuFileName);
strcat(unzip," ");
strcat(unzip,path);
//printf("The string is : %s",unzip);
system(unzip);
//getch();
}
void fmuLoad() {
fmuUnzip();
}
int main(int argc,char* argv[]) {
fmuLoad();
}
【问题讨论】:
-
尝试在你的命令行上运行
wzunzip,你应该得到同样的错误。 -
是的,我遇到了同样的错误
-
@moffeltje 我在命令提示符中也遇到了同样的错误,即使我已经在我的系统中安装了 winzip
-
嗯,这就是问题所在。重新启动计算机或找到可执行文件或重新安装
-
您是否尝试传递程序
wzunzip(char unzip[512]="/full/path/to/wzunzip";) 的完整路径?