【问题标题】:Copy different folder from text从文本复制不同的文件夹
【发布时间】:2014-10-17 02:41:53
【问题描述】:

有人可以帮帮我吗?

我有一个包含不同文件夹的 .txt 文件,我需要将所有文件夹复制到另一个文件夹。

这就是 .txt 的样子。

F:\Coinops\XBOX\G\Emulators\Vision 4\- VISION Media\- Shoot em ups\sky soldier
F:\Coinops\XBOX\G\Emulators\Vision 4\- VISION Media\- Run n Gun\tnk 3
F:\Coinops\XBOX\G\Emulators\Vision 4\- VISION Media\- Action Games\tutankham
F:\Coinops\XBOX\G\Emulators\Vision 4\- VISION Media\- Action Games\donkey kong 2

我需要复制 595 张地图。

(对不起我的英语不好)

【问题讨论】:

    标签: file batch-file text copy maps


    【解决方案1】:
    @echo off
        setlocal enableextensions disabledelayedexpansion
    
        set "targetFolder=x:\some\where"
    
        for /f "usebackq delims=" %%a in ("filelist.txt") do (
            xcopy "%%~fa\*" "%targetFolder%\%%~nxa" /y /i /e 
        )
    

    for 命令读取输入文件中的行。每行存储在%%a 可替换参数中,并为此执行xcopy 命令以从读取的源文件夹(%%~fa)的完整路径复制到具有源文件夹名称和扩展名的目标文件夹已添加 (%%~nxa)

    【讨论】:

      猜你喜欢
      • 2017-02-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多