Board logo

标题: [文件操作] 批处理命令xcopy无法读取exclude文件? [打印本页]

作者: seangg    时间: 2009-4-2 22:26     标题: 批处理命令xcopy无法读取exclude文件?

命令:
  1. xcopy "C:\Documents and Settings\cn0zgong\My Documents\Document\Source" /e /d G:\移动硬盘 G:\移动硬盘 /exclude:"%CD%\exclude.txt"
复制代码
exclude.txt的文件内容为:
qq
msn



可是运行结果为:
无法读取文件:"C:\Documents and Settings\cn0zgong\My Documents\Document\移动硬盘\批处理\同步exclude.txt"
可文件命名在当前目录

迷惑中。。。
作者: Batcher    时间: 2021-12-22 21:53

回复 1# seangg


exclude后面的文件名不要加双引号
  1. @echo off
  2. cd /d "%~dp0"
  3. > ignore.txt echo qq
  4. >>ignore.txt echo msn
  5. xcopy /e /y /exclude:ignore.txt "C:\Documents and Settings\cn0zgong\My Documents\Document\Source" "G:\移动硬盘\"
复制代码





欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2