中国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 14:58
47,811 topics / 349,897 posts / today 0 new / 48,255 members
DOS批处理 & 脚本技术(批处理室) » Seeking help~ A batch script that can change the date of the XP system to a specified date
Printable Version  3,008 / 12
Floor1 zl138689 Posted 2006-12-10 03:28
初级用户 Posts 13 Credits 39
RT! ~~ I want to make a batch script to change the date of the XP system to a specified date, and the time doesn't need to be changed. Please ask for advice from experts,....
Floor2 zl138689 Posted 2006-12-10 03:29
初级用户 Posts 13 Credits 39
Wait online, experts, please teach, thank you!~
Floor3 namejm Posted 2006-12-10 03:31
荣誉版主 Posts 1,737 Credits 5,226 From 成都
Please click here to view.
Floor4 zl138689 Posted 2006-12-10 03:33
初级用户 Posts 13 Credits 39
『Post 2』:
1. Change the current system time to the desired time;
2. type oldfile>newfile;
3. del oldfile
4. Change the time back.
Among them, type supports exe files, and you can use echo 2006-12-09 | date to modify the system time

Can you be more detailed? I don't understand very much. Thanks, moderator.
Floor5 zl138689 Posted 2006-12-10 03:35
初级用户 Posts 13 Credits 39
This seems to be about changing the file time. What I want is to change the system time. For example, now it's December 9, 2006, and I want to change it to January 1, 2007. How to write this batch script?
Floor6 a9319751 Posted 2006-12-10 03:40
中级用户 Posts 170 Credits 439
echo 2006-12-09 | date
It's for changing the system time
Floor7 zl138689 Posted 2006-12-10 03:41
初级用户 Posts 13 Credits 39
Oh, thanks. Can I just replace the following DATE with the time I want?
Floor8 tianzizhi Posted 2006-12-10 03:41
高级用户 Posts 214 Credits 623
Using the date command alone should be sufficient, no need for batch processing.
Floor9 redtek Posted 2006-12-10 03:41
金牌会员 Posts 1,147 Credits 2,902
```
C:\TEMP\KKK>date
Current date: 2006-12-09 Saturday
Enter new date: (year-month-day)

C:\TEMP\KKK>echo 2007-1-1|date
Current date: 2006-12-09 Saturday
Enter new date: (year-month-day) 2007-1-1

C:\TEMP\KKK>echo %date%
2007-01-01 Monday
```
Floor10 zl138689 Posted 2006-12-10 04:21
初级用户 Posts 13 Credits 39
The problem is solved, thank you for the reply!~~~~~~~~~~
Floor11 bybaby78 Posted 2006-12-10 05:00
新手上路 Posts 2 Credits 4
Floor12 lxmxn Posted 2006-12-10 07:26
版主 Posts 4,938 Credits 11,386

  date 2007-01-01
Floor13 electronixtar Posted 2006-12-10 09:34
铂金会员 Posts 2,672 Credits 7,493
My reply is the same as the one above.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023