找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 22950|回复: 3

[文件操作] 批处理如何根据txt文本列出的文件列表批量将文件复制到指定文件夹/目录

[复制链接]
发表于 2016-7-29 22:04:02 | 显示全部楼层 |阅读模式
本帖最后由 425528215 于 2016-7-29 23:23 编辑
从e:\asx\Windows\System32\复制到D:\qas\\Windows\System32\
从e:\asx\Windows\System32\zh-cn\复制到D:\qas\\Windows\System32\zh-cn\
如目标文件夹已经有此文件,不覆盖、不替换

1.txt内容如下,
C:\Windows\System32\input.dll
C:\Windows\System32\zh-cn\input.dll.mui
C:\Windows\System32\ctfmon.exe
C:\Windows\System32\zh-cn\ctfmon.exe.mui
C:\Windows\System32\msctf.dll
C:\Windows\System32\zh-cn\msctf.dll.mui
C:\Windows\System32\MsCtfMonitor.dll
C:\Windows\System32\msctfp.dll
C:\Windows\System32\msctfui.dll
C:\Windows\System32\zh-cn\msctfui.dll.mui
C:\Windows\System32\msutb.dll
C:\Windows\System32\zh-cn\msutb.dll.mui

评分

参与人数 1PB -2 收起 理由
pcl_test -2 未按版规发帖

查看全部评分

发表于 2016-7-29 22:26:49 | 显示全部楼层
  1. @echo off
  2. for /f "delims=" %%i in ('type "1.txt"') do (
  3.     copy /y "%%i" "D:\qas"
  4. )
复制代码

评分

参与人数 1技术 +1 收起 理由
425528215 + 1 谢谢

查看全部评分

 楼主| 发表于 2016-7-29 23:10:17 | 显示全部楼层
回复 2# gawk
如有文件重复,不覆盖,不替换!
发表于 2016-7-30 07:51:33 | 显示全部楼层
回复 3# 425528215
  1. @echo off
  2. for /f "delims=" %%i in ('type "1.txt"') do (
  3.     if not exist "D:\qas\%%~nxi" (
  4.         copy "%%i" "D:\qas"
  5.     )
  6. )
复制代码
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-17 11:32 , Processed in 0.020843 second(s), 9 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表