通过cmd和时间戳备份删除窗口中的子文件夹和文件

时间:2018-07-27 10:55:35

标签: cmd timestamp

我想在Windows中使用cmd从文件夹中删除文件和文件夹。我该怎么办?

我需要复制文件并按时间粘贴附加时间戳。

我们将不胜感激

谢谢!

1 个答案:

答案 0 :(得分:0)

要删除目录中的所有文件和子文件夹,可以使用powershell:

powershell -Command "Remove-Item 'path\to\directory' -Recurse -Force"

  • path\to\directory是您要删除这些文件的位置。

或者:

del /q "path\to\directory\*"
FOR /D %%p IN ("path\to\directory\*.*") DO rmdir "%%p" /s /q
相关问题