我无法使用c 程序清空回收站,它给出了“未指定文件路径”错误。 当我通过 command in the command prompt 时它工作得很好但在c程序中则不然。 甚至尝试在管理员模式下运行 Visual Studio。
int BinFiles()
{
char folderCommand[]= "rd /s %systemdrive%\$Recycle.bin";
system(folderCommand);
return 0;
}
最佳答案
您需要转义 \
字符:
int BinFiles()
{
char folderCommand[]= "rd /s %systemdrive%\\$Recycle.bin";
system(folderCommand);
return 0;
}
关于c - 使用c程序清空回收站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28318658/