0
我試圖通過使用cmd命令「dir」打印目錄,但系統功能打印訪問被拒絕,即使我作爲管理員運行該程序。c - 系統功能打印訪問被拒絕
char line[256];
char directory[256];
char temp[512]="dir ";
int type;
FILE* file;
puts("enter directory");
gets(directory);
strcat(temp,directory);
strcat(temp," >> d:\temp.txt");
system(temp);
file=fopen("d:\temp.txt","r");