中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-09 12:54
47,811 topics / 349,895 posts / today 0 new / 48,254 members
DOS批处理 & 脚本技术(批处理室) » [Help] Batch file for copying files, how to add pause
Printable Version  864 / 6
Floor1 rjoe Posted 2008-08-23 15:16
初级用户 Posts 21 Credits 44
I want to copy the contents of one folder to another folder, and pause after each file is copied. How can this be done with a batch file? (HAT already solved)

One more question: if I use the xcopy command, how can I pause after each folder is copied? I'm sincerely asking for advice, experts please help

[ Last edited by rjoe on 2008-8-23 at 05:36 PM ]
Floor2 HAT Posted 2008-08-23 15:20
版主 Posts 5,017 Credits 9,023
Floor3 rjoe Posted 2008-08-23 15:32
初级用户 Posts 21 Credits 44
Oh, thanks. So it turns out do( can be split across lines after it!!!) I really need to study the for command properly
Floor4 rjoe Posted 2008-08-23 16:38
初级用户 Posts 21 Credits 44
One more question: why can't xcopy copy folders? In other words, how should the variable for folders under c:\test\aaa\ be set?
Floor5 HAT Posted 2008-08-23 19:46
版主 Posts 5,017 Credits 9,023
First take a look at xcopy's help
xcopy /?
Floor6 rjoe Posted 2008-08-23 19:53
初级用户 Posts 21 Credits 44
xcopy source destination /E really can copy folders, but it won't pause. Is there any other parameter?
Floor7 rjoe Posted 2008-08-23 20:02
初级用户 Posts 21 Credits 44
@echo off
for /f "delims=" %%a in ('dir/b/ad d:\test') do (
echo d| xcopy "d:\test\%%a" "c:\test\%%a" /e /s
pause
)

Done, if there are still problems please advise!

[ Last edited by rjoe on 2008-8-24 at 12:05 AM ]
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023