【发布时间】:2015-04-03 19:32:44
【问题描述】:
我无法使用 c 程序清空我的回收站,它给出了“未指定文件路径”错误。 当我通过 command in the command prompt 但不在 c 程序中时,它可以完美运行。 甚至尝试在管理员模式下运行 Visual Studio。
int BinFiles()
{
char folderCommand[]= "rd /s %systemdrive%\$Recycle.bin";
system(folderCommand);
return 0;
}
【问题讨论】:
-
您是否尝试将环境变量替换为您传递给
system的字符串中的值? -
尝试使用 // 代替 / 和 \\ 代替 \。
标签: c command-prompt recycle-bin