![]() |
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-02 10:22 |
48,037 topics / 350,122 posts / today 0 new / 48,251 members |
| DOS批处理 & 脚本技术(批处理室) » The task assigned by the supervisor is to be handed in on Monday. Hope experts can help~DOS.BAT file renaming application |
| Printable Version 4,170 / 33 |
| Floor1 samzj | Posted 2006-10-15 09:48 |
| 初级用户 Posts 14 Credits 30 | |
|
File Renaming Application
Requirements are as follows: 1. For renaming under the command line. 2. Format: changename source 3. The extension remains unchanged. 4. destination = source + date + "@" + time, that is, the target file name is the source file name + current date + "@" + time. For example: ack.txt, assuming the running program time is 2006-09-17, 14:22:50. Execute change ack. The output result is ack20060917@142250.txt Waiting online, thank you very much... Updated, the system is 2000. [ Last edited by namejm on 2006-11-6 at 01:23 PM ] |
|
| Floor2 fastslz | Posted 2006-10-15 09:53 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
| Floor3 samzj | Posted 2006-10-15 09:55 |
| 初级用户 Posts 14 Credits 30 | |
|
The supervisor just told me it's a DOS program, and I'm still quite green in this area. The program should run under Windows 2000. Thanks.
|
|
| Floor4 fastslz | Posted 2006-10-15 10:03 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
Wait for others, I don't have a test environment in 2000
|
|
| Floor5 samzj | Posted 2006-10-15 10:09 |
| 初级用户 Posts 14 Credits 30 | |
|
Fastslz, thank you. Can you help make one for XP? After all, most in the company are 2000, but there are more than a dozen that are XP~~
|
|
| Floor6 namejm | Posted 2006-10-15 10:12 |
| 荣誉版主 Posts 1,737 Credits 5,226 From 成都 | |
|
Currently, most people are using the XP system, and the 2K system is used relatively less by individual users. The date format under XP is different from that under 2K. If the user has set the short or long format of the date, even on the same XP machine, the date format will be different, and the same may be the case under 2K. Please the landlord run date and time on your 2K machine respectively and then post the results to see. Once the date problem is solved, other problems will be easy to handle.
|
|
| Floor7 electronixtar | Posted 2006-10-15 10:14 |
| 铂金会员 Posts 2,672 Credits 7,493 | |
|
I never help others with their homework, heh heh. I won't reveal the secret that all the homework is copied by myself~~~
|
|
| Floor8 samzj | Posted 2006-10-15 10:17 |
| 初级用户 Posts 14 Credits 30 | |
|
Thanks toiled and fastslz
C:\Documents and Settings\Administrator>date Current date: 2006-10-14 Saturday Enter new date: (year/month/day) C:\Documents and Settings\Administrator>time Current time: 22:11:17.54 Enter new time: This is the XP at my home. The machines in the company, whether XP or 2000, also have the default time settings. Because I installed them all and didn't touch this aspect of the settings |
|
| Floor9 fastslz | Posted 2006-10-15 10:19 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
@echo off
for /F "tokens=1-3 delims=/- " %%A in ('date/T') do set DATE=%%A%%B%%C for /F "tokens=1-2 delims=/: " %%A in ('time/T') do set TIME=%%A%%B for %%i in (E:\ack.txt) do copy %%i E:\%%~ni%DATE%@%TIME%.txt |
|
| Floor10 samzj | Posted 2006-10-15 10:21 |
| 初级用户 Posts 14 Credits 30 | |
|
electronixtar, actually I don't want others to help with this either. I tried writing it with VB, but there were always errors. Later, the supervisor said a program under DOS was needed. I'm not very familiar with this aspect, so I found this forum to temporarily solve the immediate problem, and then I'll study it well : )
|
|
| Floor11 fastslz | Posted 2006-10-15 10:27 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
TIME can only be a 4-digit number哦,If the requirement is to rename copy to move
|
|
| Floor12 zh159 | Posted 2006-10-15 10:29 |
| 金牌会员 Posts 1,467 Credits 3,687 | |
|
Change "echo" to "copy"... The running format is all: bat *.txt (needs to bring the file extension) [ Last edited by zxcv on 2006-10-14 at 22:30 ] |
|
| Floor13 samzj | Posted 2006-10-15 10:33 |
| 初级用户 Posts 14 Credits 30 | |
|
fastslz: Thanks a million. I've run your test program and it works fine under XP. Now I just don't know how to run it under 2000. Could you provide your MSN so that I can contact you on Monday? Or my MSN: delonkgb@hotmail.com By the way, thanks to all the comrades who provided information above~
|
|
| Floor14 samzj | Posted 2006-10-15 10:42 |
| 初级用户 Posts 14 Credits 30 | |
|
Once again, thank you to all the moderators and other enthusiastic friends...
By the way, moderator qwe1234567, Can I understand that for ren *.txt *%a%.txt, I can change *.txt to test.txt to modify the TEST.TXT file? Do I need a path?? I will show you the final situation to everyone on Monday. If there are problems, trouble everyone again. Once again, thank you all for your enthusiastic help. [ Last edited by samzj on 2006-10-15 at 10:47 ] |
|
| Floor15 fastslz | Posted 2006-10-15 10:47 |
| 铂金会员 Posts 2,315 Credits 5,493 From 上海 | |
|
View my profile in MSN
|
|
| 1 2 3 Next |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |