【问题标题】:Empty Recyclebin using c program使用 c 程序清空回收站
【发布时间】: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;
}

【问题讨论】:

标签: c command-prompt recycle-bin


【解决方案1】:

您需要转义\ 字符:

int BinFiles()
{   
    char folderCommand[]= "rd /s %systemdrive%\\$Recycle.bin";
    system(folderCommand);
    return 0;
}

【讨论】:

  • 应该有一个问题,比如“为什么在代码中没有找到用单个反斜杠指定的文件”,这样我们就可以将所有此类问题标记为重复。
  • @sashoalm 可能有,虽然我找不到。我猜这方面的问题在标题中没有适当的关键字。如果找不到问题,您可以随时更改此问题的标题。
【解决方案2】:
rd /s c:\$Recycle.Bin

(在上述命令中,“c”是您的 Windows 驱动器)

然后按Y键

C:\WINDOWS\system32>rd /s c:\#Recycle.Bin
c:\#Recycle.Bin, Are you sure (Y/N)? Y

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-05-17
    • 2011-03-09
    • 1970-01-01
    • 1970-01-01
    • 2012-03-03
    • 1970-01-01
    相关资源
    最近更新 更多