中国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-12 10:05
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » To copy a specified folder in the current directory using DOS commands, you can use the `xcopy` command. For example, if the folder you want to copy is named `folder1`, and you want to copy it to the `backup` folder in the current directory, you can use the command: `xcopy folder1 backup /E /I` In this command, `/E` is used to copy directories and subdirectories, including empty ones. `/I` is used to assume that the destination is a directory if the source is more than one file or a directory.
Printable Version  4,342 / 15
Floor1 yyqfeng Posted 2010-06-08 09:10
初级用户 Posts 19 Credits 22
How to write code to copy the contents of a specified folder under the current directory to a disk? (Include empty files, do not copy the folder itself)
Floor2 Hanyeguxing Posted 2010-06-08 10:20
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
Floor3 yyqfeng Posted 2010-06-08 11:04
初级用户 Posts 19 Credits 22
@echo off
for /f "delims=ABC " %%i in ('find "ABC"') do xcopy /e %%i d:\
pause>nul
The folder I have is "ABC", and this doesn't work when written like this.
Floor4 Hanyeguxing Posted 2010-06-08 16:38
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
What is this "for /f "delims=ABC " %%i in ('find "ABC"') do " for?
Floor5 yyqfeng Posted 2010-06-09 13:58
初级用户 Posts 19 Credits 22
Is it to copy the specified "ABC" folder in the folder where the batch file is located to the F: disk?
Floor6 yyqfeng Posted 2010-06-09 18:26
初级用户 Posts 19 Credits 22
Brother Hanye, please give me a hand.
Floor7 Hanyeguxing Posted 2010-06-10 01:11
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
Copy all text files (allowing files of size 0) in the abc directory in the current directory to the F drive

And it is required to include files with hidden, system, and read-only attributes
Floor8 yyqfeng Posted 2010-06-10 21:30
初级用户 Posts 19 Credits 22
Why can't I copy files into the subfolder in the ABC folder?
Floor9 yyqfeng Posted 2010-06-10 21:42
初级用户 Posts 19 Credits 22
xcopy /e ABC I:\
pause Done
What does RH mean?
Floor10 Hanyeguxing Posted 2010-06-10 23:06
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
The poster can take a look at the parameters of xcopy, xcopy /?
1. If you want to include subdirectories, use the /s parameter
2. To copy only folders but not files, use the /t parameter
3. To include empty directories, use the /e parameter
Floor11 yyqfeng Posted 2010-06-11 14:51
初级用户 Posts 19 Credits 22
Can Brother Han Ye use batch processing to achieve key clicks to connect to another BAT file? If possible, write an example for me to learn.
Floor12 Hanyeguxing Posted 2010-06-11 15:33
银牌会员 Posts 897 Credits 1,039 From 在地狱中仰望天堂
I didn't understand what you meant...
Floor13 yyqfeng Posted 2010-06-11 17:28
初级用户 Posts 19 Credits 22
It's like there's a button on a software. For example, "OK", you click "OK" and you can open another BAT file. Can this function be realized?
Floor14 yyqfeng Posted 2010-06-11 21:04
初级用户 Posts 19 Credits 22
echo off
color 0a
cls
set a=12
set b=4
:reb
set /a a+=25
set /a b+=3
mode con: cols=%a% lines=%b%
echo ╭───╮ ╭───╮
echo │Format│ │Copy │
echo ╰───╯ ╰───╯
pause
For example, I can use the mouse to click "Format" to open the BAT file for formatting, and click "Copy" to open the BAT file for copying.
Floor15 yyqfeng Posted 2010-06-12 11:17
初级用户 Posts 19 Credits 22
Isn't it impossible to achieve?
1 2  Next
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023