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-02 02:26
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Question: How do I write this batch file View 3,800 Replies 37
Original Poster Posted 2003-03-29 00:00 ·  中国 广西 梧州 电信
初级用户
Credits 136
Posts 16
Joined 2003-03-29 00:00
23-year member
UID 1304
Gender Male
Status Offline
My computer is used by several people, all newbies, and they all like to mess around, so the machine has one problem or another almost every day (for example, the registry gets modified, the homepage gets changed, the resolution and colors get changed, etc.). I want to write a batch command so that every time it boots up it can restore the state from the previous boot. I tried using Restore Wizard, but after using it the system became much slower. I've been to some Internet cafes, and they didn't have Restore Wizard installed, but every time they booted up their machines returned to the previous state. So how is that batch command written? Please, an expert give me some guidance.
I'm a newbie, so please write it in a bit more detail. Thanks!
Floor 2 Posted 2003-03-29 00:00 ·  中国 广西 梧州 电信
初级用户
Credits 136
Posts 16
Joined 2003-03-29 00:00
23-year member
UID 1304
Gender Male
Status Offline
Why is nobody answering me... Urgent...
Just stepped out for a bit..
Now the machine has to install the graphics card driver again...
Floor 3 Posted 2003-03-29 00:00 ·  中国 吉林 吉林市 联通
银牌会员
★★★
想當一人之下萬人之上
Credits 1,275
Posts 393
Joined 2003-01-10 00:00
23-year member
UID 717
Gender Male
Status Offline
scanreg /restore

This is for restoring the registry.
<- 刷新一下换个MM
叫我Jorkin或小p就行,别再叫playboy2925了,跟提犯人似的。
如果认为小弟发的logo不错的话,给朵鲜花我就知道了。:)
Floor 4 Posted 2003-03-30 00:00 ·  中国 广西 梧州 电信
初级用户
Credits 136
Posts 16
Joined 2003-03-29 00:00
23-year member
UID 1304
Gender Male
Status Offline
This command does work... but they don't know how to use the other few things (there are girls using it)... When I'm not around they can't use the computer. Can someone help me write a batch file like the ones used in Internet cafes... Urgent...
Floor 5 Posted 2003-03-31 00:00 ·  中国 四川 眉山 电信
初级用户
Credits 123
Posts 11
Joined 2002-12-01 00:00
23-year member
UID 382
Gender Male
Status Offline
State your specific requirements, and someone on the forum will help you (be more specific).
The reason Restore Wizard is slow is that you didn't put the swap file and temporary files on an unprotected partition, or there is a lot of reading from drive C. After moving them to another drive, this problem can basically be solved.
Floor 6 Posted 2003-04-01 00:00 ·  中国 广西 梧州 电信
初级用户
Credits 136
Posts 16
Joined 2003-03-29 00:00
23-year member
UID 1304
Gender Male
Status Offline
The specific requirement is:
Every time it boots up... restore the main system files such as system.dat system.ini user.dat win.ini.
Floor 7 Posted 2003-04-01 00:00 ·  中国 广东 佛山 禅城区 电信
元老会员
★★★★
Credits 5,170
Posts 1,637
Joined 2002-10-16 00:00
23-year member
UID 8
Gender Male
From 广东佛山
Status Offline
Most Internet cafes use hard disk protection cards; you can buy one too.
我的网志
http://hzmys.blog.163.com/
我的网盘
firststep.qjwm.com
fsmys.ys168.com
ssmys.ys168.com
www.brsbox.com/fsmys
www.brsbox.com/ssmys
www.brsbox.com/ccdos
Floor 8 Posted 2003-04-01 00:00 ·  中国 广东 广州 增城区 电信
元老会员
★★★
Credits 1,468
Posts 407
Joined 2002-10-21 00:00
23-year member
UID 34
Gender Male
From 广州
Status Offline
Try the following method and see if it works:
1。Create a new folder c:\windows\sysbak
2。Back up the files system.dat system.ini user.dat win.ini into c:\windows\sysbak.
3。Add the following to CONFIG.SYS:
device=c:\windows\himem.sys
device=c:\windows\ifshlp.sys
4。Add the following to AUTOEXEC.BAT:
ATTRIB -R -S -A -H C:\WINDOWS\SYSTEM.DAT
ATTRIB -R -S -A -H C:\WINDOWS\SYSTEM.INI
ATTRIB -R -S -A -H C:\WINDOWS\USER.DAT
ATTRIB -R -S -A -H C:\WINDOWS\WIN.INI
COPY /Y c:\windows\sysbak\*.* c:\windows\
欢迎大家观临我的个人主页:

http://dosdiy.bluepc.com.cn/
http://dosdiy.ys168.com/


EMAIL: lydong@china.com.cn lydong@yeah.net
----------------------------------------------
Floor 9 Posted 2003-04-03 00:00 ·  中国 广西 梧州 电信
初级用户
Credits 136
Posts 16
Joined 2003-03-29 00:00
23-year member
UID 1304
Gender Male
Status Offline
What the poster above said doesn't work.... What should I do...
I wrote one myself as follows:
@ECHO off
cd c:\windows
attrib system.dat -h -r
attrib user.dat -h -r
del system.dat
del user.dat
del win.ini
del system.ini
cd system
cd regdate
copy . c:\windows

But it still doesn't work. Can someone tell me what's wrong?
Also, what's wrong with the one above?
Urgent urgent urgent...
Could some expert spare just a little time to help me?
Floor 10 Posted 2003-04-03 00:00 ·  中国 河南 新乡 联通
初级用户
Credits 102
Posts 1
Joined 2003-04-03 00:00
23-year member
UID 1370
Gender Male
Status Offline
The following is quoted from 菜菜菜 at 2003-4-3 9:40:57:
What the poster above said doesn't work.... What should I do...
I wrote one myself as follows:
@ECHO&nbsp;off
cd&nbsp;c:\windows
attrib&nbsp;system.dat&nbsp;-h&nbsp;-r
attrib&nbsp;user.dat&nbsp;-h&nbsp;-r
del&nbsp;system.dat
del&nbsp;user.dat
del&nbsp;win.ini
del&nbsp;system.ini
cd&nbsp;system
cd&nbsp;regdate
copy&nbsp;.&nbsp;c:\windows

But it still doesn't work. Can someone tell me what's wrong?
Also, what's wrong with the one above?
Urgent urgent urgent...
Could some expert spare just a little time to help me?



When writing batch files, try to use absolute paths as much as possible. Like what you wrote above,
cd system
cd regdate
the directories can easily get mixed up,
Floor 11 Posted 2003-04-04 00:00 ·  中国 广西 梧州 电信
初级用户
Credits 136
Posts 16
Joined 2003-03-29 00:00
23-year member
UID 1304
Gender Male
Status Offline
Brother above, can you help me write it? Because I only started learning DOS not long ago. I don't understand how to write it. Thanks.
Floor 12 Posted 2003-04-04 00:00 ·  加拿大 安大略省 多伦多
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
At most these only restore the WIN registry; it's impossible to restore other stuff. If you really want full system restoration, then go buy a restore card, and then just use the system protection program that comes with it.
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Floor 13 Posted 2003-04-04 00:00 ·  中国 广西 梧州 电信
初级用户
Credits 136
Posts 16
Joined 2003-03-29 00:00
23-year member
UID 1304
Gender Male
Status Offline
That would be fine too... how should it be written? Thanks in advance, moderator.
Floor 14 Posted 2003-04-04 00:00 ·  中国 广西 梧州 电信
初级用户
Credits 136
Posts 16
Joined 2003-03-29 00:00
23-year member
UID 1304
Gender Male
Status Offline
We're all poor students. So if we can save even a little, we save it. Moderator, could you help me write one? As long as it can restore the registry, that's enough.
Floor 15 Posted 2003-04-04 00:00 ·  加拿大 安大略省 多伦多
系统支持
★★★★★★
“新DOS时代”站长
Credits 27,736
Posts 10,521
Joined 2002-10-09 12:00
23-year member
UID 9
Status Offline
For that, of course you first need a hard disk restore card, so there is no need to write a batch file. Another method is to make a hard disk image, using software like Ghost, but full system recovery takes an especially long time, so it is not suitable for normal use and can only be used in some special situations (such as when WIN can't boot, etc.).
Wengier - 新DOS时代

欢迎大家来到我的“新DOS时代”网站,里面有各类DOS软件和资料,地址:
http://wendos.mycool.net/

E-Mail & MSN: wengierwu AT hotmail.com (最近比较忙,有事请联系DOSroot和雨露,谢谢!)

Forum Jump: