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):
varset d=date | lmod /L1 /B. -- > temp.bat
call temp.bat
del temp.bat
After the above command is run, the d environment variable will store the current date in the yyyy - mm - dd format.
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“
这个帖子”和“
这个帖子”并努力遵守,如果可能,请告诉更多的人!