Originally posted by 19951001 at 2009-2-16 20:02:
扇区的编号是从0开始,根据上述结果扇区总数为1048576那么扇区的编号应该是 0..1048575 ,最后一个扇区的编号应该是1048575
呵呵,谢谢回复!关于扇区数,我是知道的。
情况是这样的,有个软件把 KEY 写到最后一个扇区里了,
但是重启电脑后KEY就没了
我只是想做个批处理把KEY备份出来,
重启时写回KEY。
但是我水平不行,搞不定啦
下面是我的备份 KEY 的批处理:
dspt 0 0 1 /s 0.dat /y 备份0扇区 0.dat
dspt 0 /dpr /y 最后扇区写到0扇区
dspt 0 0 1 /s K.dat /y 备份0扇区 k.dat
dspt 0 0 1 /r 0.dat /y 恢复0扇区
不是我白痴啦,想做个通用的,因为各个电脑的扇区数是不确定的,
我页不知道如何得到最后一个扇区的位置数,
所以才这么麻烦,
这个需求比较特殊 !
我只是想问问,谁有纯 DOS 下的计算器?
比如:
calc 1024-1
得出1023就可以了
Last edited by zhaoliang518 on 2009-2-16 at 21:00 ]
Originally posted by 19951001 at 2009-2-16 20:02:
Sector numbering starts from 0. According to the above result, the total number of sectors is 1048576, so the sector numbers should be 0..1048575, and the number of the last sector should be 1048575
Hehe, thank you for the reply! Regarding the number of sectors, I do know it.
The situation is like this: There is a software that writes the KEY into the last sector,
but after restarting the computer, the KEY is gone
I just want to make a batch processing to back up the KEY,
and write back the KEY when restarting.
But I'm not good at it and can't figure it out
The following is my batch processing for backing up the KEY:
dspt 0 0 1 /s 0.dat /y Back up sector 0 to 0.dat
dspt 0 /dpr /y Write the last sector to sector 0
dspt 0 0 1 /s K.dat /y Back up sector 0 to K.dat
dspt 0 0 1 /r 0.dat /y Restore sector 0
It's not that I'm an idiot, I want to make it universal because the number of sectors in each computer is uncertain,
I also don't know how to get the position number of the last sector,
so it's so troublesome,
This requirement is relatively special!
I just want to ask, who has a pure DOS calculator?
For example:
calc 1024-1
Get 1023 is okay
Last edited by zhaoliang518 on 2009-2-16 at 21:00 ]