简体   繁体   中英

windows batch script: copy command issue

I've an issue with copy command I'm using in my script. The command syntax is correct (to the best of my knowledge) but this command displays the error of "Path not found"; although the path is present, the file is also present. Not sure what the issue is. My command:

if exist D:\CDDATA\LIP\APin.dat* (copy D:\CDDATA\LIP\APin.dat* "D:\CDDATA\LIP\Temp\Apconf.dat") else goto exit12

I tried using xcopy instead but it waits for an input while running:

Does D:\CDDATA\LIP\Temp\Apconf.dat specify a file name
or directory name on the target
(F = file, D = directory)? 

Tried to suppress it using /C but won't work. Any suggestions??

Thanks in advance, Adil

来了,下一次更好地解释您的问题

copy /y D:\CDDATA\LIP\APin.dat D:\CDDATA\LIP\Temp\Apconf.dat

要在没有提示的情况下xcopy到文件夹,请使用反斜杠结束路径或使用/I开关。

"D:\CDDATA\LIP\Temp\Apconf.dat\"
mkdir "D:\CDDATA\LIP\Temp\"
xcopy "D:\CDDATA\LIP\APin.dat" "D:\CDDATA\LIP\Temp\Apconf.dat"/Y/H/v/s

Try making the directory FIRST in xcopy THEN copying the files. That works for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM