中国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-10 16:54
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS疑难解答 & 问题讨论 (解答室) » Can such a batch processing be done?
Printable Version  2,002 / 2
Floor1 dooza Posted 2004-07-24 00:00
初级用户 Posts 1 Credits 106
There is an application that creates subdirectories named with dates under the c:\home directory every day, such as 2004-07-24. I want to use a batch process to implement the backup of this directory. I don't know how to do it well. There are nearly three months of such subdirectories in c:\home. I want to judge the directories to be backed up by comparing the current date and the directory name. Is that possible? And how to implement it?
Floor2 Climbing Posted 2004-07-26 00:00
铂金会员 Posts 2,753 Credits 6,962 From 河北保定
1. Your question was ignored because the title was not clear enough (it is recommended that you carefully read the sticky post). I suggest writing it like this: How to generate an environment variable with the current date as the content in batch processing?
2. The running environment you provided is not detailed enough. For example, under which system will you run this batch file, is it pure DOS, or 98, or 2k/xp/2003?
3. Your problem is not a very difficult one to solve, but different environments require different methods. Under 2k/xp/2003, you can directly use the %date% environment variable as the current date. Using Horst's varset and lmod programs can also achieve this (this should be considered a general solution, and I tested it under 2003):

After the above command is run, the d environment variable will store the current date in the yyyy - mm - dd format.
Floor3 stonelei Posted 2004-08-25 00:00
初级用户 Posts 14 Credits 172
May I ask the original poster, has this problem been resolved?
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023