![]() |
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-15 06:22 |
47,812 topics / 349,917 posts / today 0 new / 48,268 members |
| DOS开发编程 & 发展交流 (开发室) » If DOS can't do it, then I can only rely on C |
| Printable Version 824 / 7 |
| Floor1 可乐泡饭 | Posted 2003-11-22 00:00 |
| 初级用户 Posts 15 Credits 155 | |
|
Under DOS
I'm trying to make a BAT batch file under DOS. Its task is to copy all folders in H:, including subfolders and all files, into a folder on D: named after the current system time, while keeping the original directory structure of H:. Then delete all folders and files in H:. Now I've run into one difficulty: that is, how to copy the content to the destination drive, and put it into a folder created on the spot. This folder can be named arbitrarily, preferably after the current system time. How do I do this? Please teach me! |
|
| Floor2 jddj007 | Posted 2003-11-23 00:00 |
| 初级用户 Posts 11 Credits 146 | |
|
Using environment variables should work, right?
|
|
| Floor3 可乐泡饭 | Posted 2003-11-23 00:00 |
| 初级用户 Posts 15 Credits 155 | |
The following is a quote from jddj007 at 2003-11-23 11:28:50: Can you teach me? |
|
| Floor4 lemonhall | Posted 2003-11-23 00:00 |
| 高级用户 Posts 183 Credits 639 | |
|
You're making a backup, right? Hehe. I suggest not using direct COPY, GHOST would be better. Go search for GHOST's command-line usage first.
As for that date/time string, use C, or BASIC would be fine too, just don't use batch processing. No hope there. If you're a system administrator, use PERL or some other scripting tool to do it.(WSHELL) Don't count on simple BATCH. |
|
| Floor5 可乐泡饭 | Posted 2003-11-23 00:00 |
| 初级用户 Posts 15 Credits 155 | |
The following is a quote from lemonhall at 2003-11-23 18:41:04: It's not for backup. The main purpose is to save time, speed comes first, one-step completion. |
|
| Floor6 lemonhall | Posted 2003-11-24 00:00 |
| 高级用户 Posts 183 Credits 639 | |
|
Are you using pure DOS? If not, use WINRAR, it's the fastest, and you don't even need to write a script.
WINRAR has an option to use the date and time directly as the filename when creating an archive. Use store mode for packing, that's also a common method. The filename will often be generated as XXX200310281923.RAR, the date and time are all based on your system. "Save time, speed comes first, one-step completion"??????????????????????????????? Where are you from? A government office? You're really good at shouting slogans! ![]() |
|
| Floor7 可乐泡饭 | Posted 2003-11-26 00:00 |
| 初级用户 Posts 15 Credits 155 | |
The following is a quote from lemonhall at 2003-11-24 11:10:17: It really is pure DOS, because my little 50M notebook uses too much power. When I'm out shooting and downloading CF cards, I have no choice but to use DOS to save time and battery power. Right now I'm using Volkov Commander 4.99, but it still feels like too much trouble~. The palm-sized little notebook has too small a keyboard, so I hope to get it done with one key~. A lot of friends using 50M machines need this convenient program~. Too bad nobody knows how to write it~ :) |
|
| Floor8 aria | Posted 2003-12-13 00:00 |
| 高级用户 Posts 243 Credits 924 | |
|
Can't the time command under DOS get the time?
|
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |