![]() |
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-09-23 15:27 |
47,812 topics / 349,917 posts / today 0 new / 48,273 members |
| DOS批处理 & 脚本技术(批处理室) » [Help] A batch file assignment question |
| Printable Version 1,483 / 3 |
| Floor1 stu123 | Posted 2005-11-12 16:51 |
| 新手上路 Posts 1 Credits 6 | |
|
Write a DOS batch file with the following functions: copy the log files from the Windows system directory into a newly created directory LOG, save the directory listing of that directory into the file dir.txt, and rename all the log files as 1.log, 2.log, 3.log...
How do I do the last part!! Urgent! |
|
| Floor2 jzhupo | Posted 2005-11-17 08:27 |
| 中级用户 Posts 53 Credits 347 | |
|
I'll try to give my idea, but it's limited by the number of files.
See below for the files one.bat and two.bat. When running it, please execute one.bat. |
|
| Floor3 jzhupo | Posted 2005-11-17 08:28 |
| 中级用户 Posts 53 Credits 347 | |
|
@echo off
set number=1 for %%u in (C:\Winnt\*.log) do call two.bat %%u 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 rem The numbers continue up to the upper limit of the file count |
|
| Floor4 jzhupo | Posted 2005-11-17 08:28 |
| 中级用户 Posts 53 Credits 347 | |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |