|
北山愚公
初级用户
 
积分 154
发帖 15
注册 2005-1-31
状态 离线
|
『楼 主』:
[求助]批处理文件如否达到自动寻找并进入某个光盘运行特定
使用 LLM 解释/回答一下
我想制作一个启动光盘,在光盘上同时安放操作系统的ghost备份及ghost软件。由于启动光盘具有双重身份,启动后显示的盘符是A盘,而ghost备份是在光驱那个盘中,使用起来应转换盘符,有点不方便。
我想,如果编一个独立的ghost.bat放进启动的文件中,一般这个光盘仍当启动盘用,而当需要恢复ghost备份时就执行该文件,是否能过到DOS系统自动执行光驱中的ghost文件吗?
由于各个机子的光驱盘符因分区数量不同而有很大的差异,有的人是D盘符,而有的人却是G盘符或其它,有的机子甚至多了一个刻录机。请教各位高手:如何才能使DOS自动寻找光驱并定位到光盘所在的那个盘中呢?这段批处理应如何写?先谢了
I want to make a bootable CD, placing both the operating system's ghost backup and the ghost software on the CD. Since the bootable CD has a dual identity, the drive letter displayed after booting is drive A, while the ghost backup is on the CD drive, and it's inconvenient to switch drive letters when using it.
I thought that if I compile an independent ghost.bat and put it into the boot files, generally this CD is still used as a boot disk, and when I need to restore the ghost backup, I execute this file. Can the DOS system automatically execute the ghost file in the CD drive?
Because the drive letter of the CD drive on each computer varies greatly due to the different number of partitions. Some people have drive D, while some have drive G or others, and some computers even have an additional burner. I would like to ask all experts: How can I make DOS automatically find the CD drive and locate the disk where the CD is? How should this batch processing be written? Thanks in advance.
|
|
2005-2-1 00:00 |
|
|
JonePeng
金牌会员
      D◎$ Fαп
积分 4562
发帖 1883
注册 2004-1-19 来自 广东广州
状态 离线
|
|
2005-2-1 00:00 |
|
|
北山愚公
初级用户
 
积分 154
发帖 15
注册 2005-1-31
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
好极了!多谢JonePeng兄指教。
Great! Thanks to Brother JonePeng for the guidance.
|
|
2005-2-2 00:00 |
|
|
mtx
初级用户
 
积分 187
发帖 21
注册 2005-1-22
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
以下是引用JonePeng在2005-2-1 15:02:44的发言:
方法一(用FINDCD.EXE):
Wengier的MSDOS 7.1启动盘有个FindCD.exe的小程序,有了它,确认光驱盘符很容易!运行之,会自动将光驱盘符存放在%CDROM%这个环境变量中。于是GHOST.BAT用几行就写成了(下面假设GHOST程序存放在你的光盘的\GHOST文件夹):
@echo off
findcd
%cdrom%
cd\ghost
ghost
方法二(修改AUTOEXEC.BAT):
驱动光驱的MSCDEX或SHSUCDX命令可以将光驱设为一个特定盘符。如:
MSCDEX /D:IDE-CD /L:Z
或
SHSUCDX /D:IDE-CD,Z
不管硬盘有几个分区,甚至没有硬盘,都可以将光驱定为Z:。这样批处理就更简单了:
@echo off
z:
cd\ghost
ghost
将光驱定为Z:的话如果有几个光驱会带来一些麻烦,将光驱定为比较好些.
If the CD - ROM is set to Z: it will bring some troubles if there are several CD - ROMs. It is better to set the CD - ROM to a more appropriate letter.
|
|
2005-2-2 00:00 |
|
|
cn_archer
元老会员
         农民
积分 2903
发帖 991
注册 2003-7-23 来自 福建省
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
用FoundCD可以把光盘的盘符放到变量里去, 再用%CDROM%就可以直接跳转到光盘上。FoundCD程序在Wengier的启动盘里可以找到。
You can use FoundCD to put the drive letter of the CD into a variable, and then use %CDROM% to directly jump to the CD. The FoundCD program can be found in Wengier's bootable disk.
|

艰难奋长戟,万古用一夫
中国DOS联盟 http://www.cn-dos.net 欢迎大家来共同学习
我的MSN&E-Mail cn_archer@hotmail.com QQ 56049418
|
|
2005-2-2 00:00 |
|
|
北山愚公
初级用户
 
积分 154
发帖 15
注册 2005-1-31
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
多谢版主教诲。可我是个菜鸟,最怕的就是变量,您能说得详细些吗?当然如能象上面的兄台那样把整个批处理文件都写出来, 则再好不过了,我也可以边模仿边学习。谢谢。另:谢谢4楼的mtx兄提醒。
Thanks to the instructor's teachings. But I'm a newbie, and I'm most afraid of variables. Can you explain it in detail? Of course, if you can write out the entire batch file like the brother above, then it's the best, and I can also learn while imitating. Thanks. Another: Thanks to brother mtx from 4th floor for the reminder.
|
|
2005-2-2 00:00 |
|
|
cn_archer
元老会员
         农民
积分 2903
发帖 991
注册 2003-7-23 来自 福建省
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
二楼的JonePeng已经说得很清楚了,照搬他的例子就能应用了。我昨天发帖时没认真看他的帖子,惭愧。
The JonePeng on the second floor has already made it very clear. Just follow his example to apply it. I didn't read his post carefully when I posted yesterday. I'm ashamed.
|

艰难奋长戟,万古用一夫
中国DOS联盟 http://www.cn-dos.net 欢迎大家来共同学习
我的MSN&E-Mail cn_archer@hotmail.com QQ 56049418
|
|
2005-2-3 00:00 |
|
|
zhouhb
中级用户
  
积分 230
发帖 104
注册 2006-4-21
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
高人啊,向你们学习!
Great minds, I'm learning from you!
|
|
2006-4-21 13:52 |
|
|
kingchain
初级用户
 
积分 133
发帖 57
注册 2006-3-15
状态 离线
|
|
2006-4-21 13:58 |
|
|
vct852
初级用户
 
积分 46
发帖 17
注册 2006-4-27
状态 离线
|
|
2006-4-28 02:17 |
|
|
xuantian
高级用户
   
积分 587
发帖 282
注册 2006-4-10
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
多个光驱时可以分别为光驱指定盘符,也不会乱的
When there are multiple CD - ROM drives, you can assign drive letters to the CD - ROM drives respectively, and there won't be any confusion.
|
|
2006-4-29 11:51 |
|
|
yeziwanlove
新手上路

积分 15
发帖 6
注册 2006-4-23 来自 河北
状态 离线
|
|
2006-5-4 21:34 |
|