是否有任何批处理命令来移动文件和删除空子文件夹

时间:2021-12-11 02:28:37

Anyone know of a simple batch command to move files and delete empty sub folders? Just got a new external and when I copied everything over it resulted in something like this. F:\Music\John Denver\John Denver\files1-10 F:\Music\TheBeatles\TheBeatles\files1-10 and so on, for say, 350+ folders. I don't want to waste that much time manually moving them up one folder and deleting sub folders... Not all files are same file type, and not all folders are music. Some folders have other sub folders that I want to keep (mostly for music files, such as artist\album\files) Is there a way to do this instead of the old fashioned way? Any help is appreciated.

有人知道一个简单的批处理命令来移动文件和删除空子文件夹吗?刚刚得到一个新的外部,当我复制它的一切导致这样的事情。 F:\ Music \ John Denver \ John Denver \ files1-10 F:\ Music \ TheBeatles \ TheBeatles \ files1-10等等,比方说350+个文件夹。我不想浪费那么多时间手动将它们移动到一个文件夹并删除子文件夹...并非所有文件都是相同的文件类型,并非所有文件夹都是音乐。有些文件夹有其他我想要保留的子文件夹(主要用于音乐文件,例如artist \ album \ files)有没有办法做到这一点而不是老式的方式?任何帮助表示赞赏。

1 个解决方案

#1


You can use ROBOCOPY.

你可以使用ROBOCOPY。

ROBOCOPY source destination /S /MOVE

/S flag is used to exclude empty subfolders.

/ S标志用于排除空子文件夹。

ROBOCOPY "F:\Music\John Denver\John Denver\files1-10" "F:\Music\TheBeatles\TheBeatles\files1-10" /S /MOVE

#1


You can use ROBOCOPY.

你可以使用ROBOCOPY。

ROBOCOPY source destination /S /MOVE

/S flag is used to exclude empty subfolders.

/ S标志用于排除空子文件夹。

ROBOCOPY "F:\Music\John Denver\John Denver\files1-10" "F:\Music\TheBeatles\TheBeatles\files1-10" /S /MOVE