China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 04:33
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » If DOS can't do it, then I can only rely on C View 759 Replies 7
Original Poster Posted 2003-11-22 00:00 ·  中国 湖北 武汉 联通
初级用户
Credits 155
Posts 15
Joined 2003-11-22 00:00
22-year member
UID 13200
Gender Male
Status Offline
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!
Floor 2 Posted 2003-11-23 00:00 ·  中国 安徽 芜湖 电信
初级用户
Credits 146
Posts 11
Joined 2003-06-22 00:00
23-year member
UID 5691
Gender Male
Status Offline
Using environment variables should work, right?
Floor 3 Posted 2003-11-23 00:00 ·  中国 湖北 武汉 联通
初级用户
Credits 155
Posts 15
Joined 2003-11-22 00:00
22-year member
UID 13200
Gender Male
Status Offline
The following is a quote from jddj007 at 2003-11-23 11:28:50:
Using environment variables should work, right?


Can you teach me?
Floor 4 Posted 2003-11-23 00:00 ·  中国 陕西 西安 教育网
高级用户
★★
OS/2女孩
Credits 639
Posts 183
Joined 2003-06-14 00:00
23-year member
UID 5148
Gender Female
Status Offline
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.
REM 喜欢DOS,因为它的简单
REM 喜欢OS/2,因为它不再矫饰
REM 喜欢BASIC,因为它并不幼稚
REM 喜欢GNU,因为它杂乱无章
Floor 5 Posted 2003-11-23 00:00 ·  中国 湖北 武汉 联通
初级用户
Credits 155
Posts 15
Joined 2003-11-22 00:00
22-year member
UID 13200
Gender Male
Status Offline
The following is a quote from lemonhall at 2003-11-23 18:41:04:
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.



It's not for backup. The main purpose is to save time, speed comes first, one-step completion.
Floor 6 Posted 2003-11-24 00:00 ·  中国 陕西 西安 教育网
高级用户
★★
OS/2女孩
Credits 639
Posts 183
Joined 2003-06-14 00:00
23-year member
UID 5148
Gender Female
Status Offline
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!
REM 喜欢DOS,因为它的简单
REM 喜欢OS/2,因为它不再矫饰
REM 喜欢BASIC,因为它并不幼稚
REM 喜欢GNU,因为它杂乱无章
Floor 7 Posted 2003-11-26 00:00 ·  中国 湖北 武汉 电信
初级用户
Credits 155
Posts 15
Joined 2003-11-22 00:00
22-year member
UID 13200
Gender Male
Status Offline
The following is a quote from lemonhall at 2003-11-24 11:10:17:
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!



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~
:)
Floor 8 Posted 2003-12-13 00:00 ·  中国 天津 南开区 电信
高级用户
★★
Credits 924
Posts 243
Joined 2003-07-09 00:00
23-year member
UID 6612
Gender Male
Status Offline
Can't the time command under DOS get the time?
Forum Jump: