|
sglxy
中级用户
   MS-DOS爱好者
积分 397
发帖 87
注册 2002-12-15
状态 离线
|
『楼 主』:
(已结)如何在DOS下获得本机硬盘最后一个分区的盘符?
使用 LLM 解释/回答一下
我在电脑维护过程中常常遇到这样一个问题:
被维护的机器上曾经GHOST做过系统映像文件,但是不知道放在硬盘的那一个分区下的那一个目录里。这样我就在考滤,如果编一个批处理,让它自动获取当前硬盘的所有分区盘符,然后在用dir /s/e “盘符”:\*.gho 这条命令来查找映像文件。但是现在不知道哪个dos下的程序有这个功能,可以列出当前硬盘上的全部分区盘符。
我记得在论坛上曾经有一位兄弟问过相似的问题,当时有一位大侠想他提供了一个dos下的小程序,可以很方便的将当前硬盘分区一每行一个分区号的形式输出到一个文本文件中。当时我没有注意,现在却怎么也找不到那个帖子了,请问那位兄弟知道,或者另有好方法解决,麻烦您告诉我,谢谢!
Last edited by willsort on 2005-10-6 at 23:02 ]
In the process of computer maintenance, I often encounter such a problem:
The machine being maintained once had a system image file made by GHOST, but I don't know which partition and which directory on the hard disk it is placed in. So I am considering that if I compile a batch file, let it automatically obtain all the drive letters of the current hard disk, and then use the command dir /s/e "drive letter":\*.gho to find the image file. But now I don't know which program under DOS has this function, which can list all the partition drive letters on the current hard disk.
I remember that a brother once asked a similar question on the forum. At that time, a expert provided him with a small program under DOS, which can very conveniently output all the partition numbers of the current hard disk in the form of one partition number per line to a text file. At that time, I didn't pay attention, but now I can't find that post at all. Does that brother know, or is there another good way to solve it? Please tell me, thank you!
Last edited by willsort on 2005-10-6 at 23:02 ]
|
|
2005-10-5 14:03 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
 『第 2 楼』:
使用 LLM 解释/回答一下
Re sglxy:
就你的情形,可以考虑使用 locate 定位 gho 文件的路径,此程序在本论坛的超级启动盘中可以找到。类似这样的用法:
locate *.gho /n /f1 /b9:"ghost ...." > _restore.bat
call _restore.bat ...
Re sglxy:
For your situation, you can consider using locate to locate the path of the gho file. This program can be found in the super startup disk of this forum. The usage is similar to:
locate *.gho /n /f1 /b9:"ghost ...." > _restore.bat
call _restore.bat ...
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-10-5 15:11 |
|
|
sglxy
中级用户
   MS-DOS爱好者
积分 397
发帖 87
注册 2002-12-15
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
谢谢willsort老师的解答,locate这个程序还真的是没见过,或许是以前只用“超级启动盘”但从来注意过它。
Thanks to teacher willsort for the explanation. The locate program is really something I've never seen before. Maybe I've only used "Super Boot Disk" before and never paid attention to it.
|
|
2005-10-5 18:00 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2005-10-5 19:45 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2005-10-5 19:50 |
|
|
sglxy
中级用户
   MS-DOS爱好者
积分 397
发帖 87
注册 2002-12-15
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
谢谢你,请问在批处理中如何使用ncd命令?
Thank you, may I ask how to use the ncd command in batch processing?
|
|
2005-10-5 20:42 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2005-10-6 09:13 |
|
|
sglxy
中级用户
   MS-DOS爱好者
积分 397
发帖 87
注册 2002-12-15
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
Originally posted by willsort at 2005-10-5 03:11 PM:
Re sglxy:
就你的情形,可以考虑使用 locate 定位 gho 文件的路径,此程序在本论坛的超级启动盘中可以找到。类似这样的用法:
locate *.gho / ...
willsort老师,在你l列出的这行命令中:
locate *.gho /n /f1 /b9:"ghost ...." > _restore.bat
意思是否是说将“locate *.gho /n /f1 /b9:”的搜索结果作为变量输出到ghost命令行中?那么变量名是什么呢?
Originally posted by willsort at 2005-10-5 03:11 PM:
Re sglxy:
For your situation, you can consider using locate to locate the path of the gho file. This program can be found in the super startup disk of this forum. Usage similar to:
locate *.gho / ...
Teacher willsort, in the line of command you listed:
locate *.gho /n /f1 /b9:"ghost ...." > _restore.bat
Does it mean that the search result of "locate *.gho /n /f1 /b9:" is output as a variable to the ghost command line? Then what is the variable name?
|
|
2005-10-6 12:23 |
|
|
willsort
元老会员
         Batchinger
积分 4432
发帖 1512
注册 2002-10-18
状态 离线
|
  『第 9 楼』:
使用 LLM 解释/回答一下
Re sglxy:
此句意为将locate的输出嵌入到ghost命令行中,并加上一行@echo off后输出,我们将这个输出重定向到了批处理 _restore.bat ,而后我们调用了它。
但是考虑到locate会默认将搜索的镜像文件路径作为命令的第一参数,而 ghost 的命令行可能并不允许这种用法,所以将路径保存到环境变量中可能是更恰当的用法。如下:
locate *.gho /n /f1 /b:"set _ghofile=" > _setghof.bat
call _setghof.bat
del _setghof.bat
ghost -clone...%_ghofile%...
Re: sglxy:
This sentence means embedding the output of locate into the ghost command line, adding a line @echo off and then outputting, we redirected this output to the batch _restore.bat, and then we called it.
But considering that locate will default to taking the path of the searched image file as the first parameter, and the ghost command line may not allow this usage, so saving the path to an environment variable may be a more appropriate usage. As follows:
locate *.gho /n /f1 /b:"set _ghofile=" > _setghof.bat
call _setghof.bat
del _setghof.bat
ghost -clone...%_ghofile%...
|

※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得! |
|
2005-10-6 15:37 |
|
|
sglxy
中级用户
   MS-DOS爱好者
积分 397
发帖 87
注册 2002-12-15
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
我看明白了,willsort老师,谢谢你!
I understand now, Teacher willsort, thank you!
|
|
2005-10-6 22:18 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2005-10-9 08:50 |
|
|
sglxy
中级用户
   MS-DOS爱好者
积分 397
发帖 87
注册 2002-12-15
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
"此程序在本论坛的超级启动盘中可以找到。"
This program can be found in the super boot disk of this forum.
|
|
2005-10-9 12:29 |
|
|
chujiafu
银牌会员
    
积分 1337
发帖 594
注册 2004-5-26 来自 安徽 宿州
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
如果.gho文件是隐藏的呢?用Locate行吗?与其用自动的方法,不如用人工的方法:Dir d:\.gho/s或Dir d:\.gho/s/a,这是查找D:盘的,查其它盘的方法相同。
What if the .gho file is hidden? Can Locate be used? Instead of using an automatic method, it's better to use a manual method: Dir d:\.gho/s or Dir d:\.gho/s/a. This is for searching the D drive, and the method for searching other drives is the same.
|
|
2005-10-9 18:33 |
|