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-06-25 06:51
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Seeking help~ A batch script that can change the date of the XP system to a specified date View 2,938 Replies 12
Original Poster Posted 2006-12-10 03:28 ·  中国 浙江 金华 电信
初级用户
Credits 39
Posts 13
Joined 2006-12-10 02:55
19-year member
UID 73078
Gender Male
Status Offline
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,....
Floor 2 Posted 2006-12-10 03:29 ·  中国 浙江 金华 电信
初级用户
Credits 39
Posts 13
Joined 2006-12-10 02:55
19-year member
UID 73078
Gender Male
Status Offline
Wait online, experts, please teach, thank you!~
Floor 3 Posted 2006-12-10 03:31 ·  中国 广东 电信
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
Please click here to view.
尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。
Floor 4 Posted 2006-12-10 03:33 ·  中国 浙江 金华 电信
初级用户
Credits 39
Posts 13
Joined 2006-12-10 02:55
19-year member
UID 73078
Gender Male
Status Offline
『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.
Floor 5 Posted 2006-12-10 03:35 ·  中国 浙江 金华 电信
初级用户
Credits 39
Posts 13
Joined 2006-12-10 02:55
19-year member
UID 73078
Gender Male
Status Offline
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?
Floor 6 Posted 2006-12-10 03:40 ·  中国 河南 郑州 电信
中级用户
★★
Credits 439
Posts 170
Joined 2006-01-09 20:29
20-year member
UID 48707
Status Offline
echo 2006-12-09 | date
It's for changing the system time
bat c c++
Floor 7 Posted 2006-12-10 03:41 ·  中国 浙江 金华 电信
初级用户
Credits 39
Posts 13
Joined 2006-12-10 02:55
19-year member
UID 73078
Gender Male
Status Offline
Oh, thanks. Can I just replace the following DATE with the time I want?
Floor 8 Posted 2006-12-10 03:41 ·  中国 江苏 徐州 沛县 电信
高级用户
★★
Credits 623
Posts 214
Joined 2006-09-22 20:48
19-year member
UID 63387
Status Offline
Using the date command alone should be sufficient, no need for batch processing.
Floor 9 Posted 2006-12-10 03:41 ·  中国 北京 朝阳区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
```
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
```
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 10 Posted 2006-12-10 04:21 ·  中国 浙江 金华 电信
初级用户
Credits 39
Posts 13
Joined 2006-12-10 02:55
19-year member
UID 73078
Gender Male
Status Offline
The problem is solved, thank you for the reply!~~~~~~~~~~
Floor 11 Posted 2006-12-10 05:00 ·  中国 江苏 常州 联通
新手上路
Credits 4
Posts 2
Joined 2006-12-10 04:25
19-year member
UID 73085
Gender Male
Status Offline
Floor 12 Posted 2006-12-10 07:26 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline

  date 2007-01-01
Floor 13 Posted 2006-12-10 09:34 ·  中国 四川 成都 教育网
铂金会员
★★★★
Credits 7,493
Posts 2,672
Joined 2005-09-02 00:00
20-year member
UID 42173
Gender Male
Status Offline
My reply is the same as the one above.

C:\>BLOG http://initiative.yo2.cn/
C:\>hh.exe ntcmds.chm::/ntcmds.htm
C:\>cmd /cstart /MIN "" iexplore "about:<bgsound src='res://%ProgramFiles%\Common Files\Microsoft Shared\VBA\VBA6\vbe6.dll/10/5432'>"
Forum Jump: