【发布时间】:2016-02-18 13:49:01
【问题描述】:
我的批处理脚本xcopy 仍然要求F = file, D = directory 确认,即使我在脚本中添加了/F,日志显示如下。
请帮助了解如何避免要求确认。
脚本:
net use p: /delete
net use p: "\\200clan\F_Drive" /USER:adm /PERSISTENT:NO-1111
set source=%1
set target=p:/%2
echo %source% %target%
xcopy /S /I /Q /Y /F "%source%" "%target%"
日志:
C:\test\foldera>xcopy /S /I /Q /Y /F "C:/test/folder1/folder2/logs/154/compareReport_177.html" "p:/Services/WSDLCompare/177_20151116/compareReport_177.html" Does P:\Services\WSDLCompare\177_20151116\UIReport_177.html specify a file name or directory name on the target (F = file, D = directory)?
【问题讨论】:
-
如果您不想费心查看
xcopy的所有详细信息和选项,请在目标路径的末尾添加back-slash%target\% -
@mchar,但是你必须像
%target%\一样将它移到一个位置(所以在关闭%之后)...
标签: windows batch-file cmd xcopy