将文件夹列表复制到另一个文件夹?


1

无论如何,我可以将文本文件中的文件夹列表复制到Windows中的另一个文件夹吗?

我有这样的文字:

87312
87313 
87314 
87315
...

我认为通过Powershell可以实现。

Answers:


2

假设您的文本文件包含要复制的文件夹的整个路径(每行可能是路径),这里有一个可能对您有用的脚本:

$folders = Get-Content C:\Users\Antoine\Desktop\folders.txt
foreach ($folder in $folders)
{
    Copy-Item -path $folder -destination C:\Test3 -Recurse

}

您只需修改文本文件的路径和目标。

希望这可以帮助 !

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.