|
zahy006
初级用户
 
积分 69
发帖 23
注册 2006-12-7
状态 离线
|
『楼 主』:
请教各位,怎么才能用批处理判断最后一个盘符?
使用 LLM 解释/回答一下
能在DOS下运行的批处理,并且正确地找到最后一个盘符。
其实我是为了要做ghost自动备份并且放在最后的盘符。
但是不知道怎么才能指定为最后一个盘符。
能在NTFS格式的硬盘上也能用的…………
麻烦知道的前辈们告诉我一下,小弟万分感激………………
另外……DOS支持NTFS。。。
Batch scripts that can run under DOS and correctly find the last drive letter.
Actually, I'm trying to make a Ghost automatic backup and put it on the last drive letter.
But I don't know how to specify it as the last drive letter.
It needs to work on NTFS - formatted hard drives...
Troubled seniors, please tell me, little brother is very grateful...
Also... DOS supports NTFS.
|
|
2006-12-29 10:26 |
|
|
everest79
金牌会员
      一叶枝头,万树皆春
积分 2564
发帖 1127
注册 2006-12-25
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
这样的话你不应把重点放在盘符上,而应是磁盘数与分区数
In this case, you shouldn't focus on the drive letters, but rather on the number of disks and partitions.
|
|
2006-12-29 10:45 |
|
|
zahy006
初级用户
 
积分 69
发帖 23
注册 2006-12-7
状态 离线
|
『第 3 楼』:
使用 LLM 解释/回答一下
关键是,我想用在不同的电脑上,如果说有个电脑是3个分区,而另一个是4个分区的话怎么办?
The key is, I want to use it on different computers. If one computer has 3 partitions and another has 4 partitions, what should I do?
|
|
2006-12-29 10:46 |
|
|
everest79
金牌会员
      一叶枝头,万树皆春
积分 2564
发帖 1127
注册 2006-12-25
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
所以才让你想办法获取磁盘与分区数呀,在DOS下例如NTFS是不会有盘符的
而且磁盘数问题更大,因为ghost对磁盘序列使用自已的逻辑,它默认引导硬盘为第一块硬盘,只有以其它设备引导才会按IDE的主从接口来判断
你想使用这样的命令就一定得获得磁盘与分区数
GHOST -clone,mode=pdump,src=%sd%:%sp%,dst=%dd%:%dp%\sys.gho -sure -z9 -rb
So that's why you need to find a way to get the number of disks and partitions. In DOS, for example, NTFS won't have a drive letter. And the problem with the number of disks is even bigger because Ghost uses its own logic for disk sequences. It defaults to the boot hard drive as the first disk, and only when booted from other devices will it judge according to the master-slave interface of IDE. You must get the number of disks and partitions if you want to use such a command. GHOST -clone,mode=pdump,src=%sd%:%sp%,dst=%dd%:%dp%\sys.gho -sure -z9 -rb
|
|
2006-12-29 11:03 |
|
|
zahy006
初级用户
 
积分 69
发帖 23
注册 2006-12-7
状态 离线
|
『第 5 楼』:
使用 LLM 解释/回答一下
难道不能直接判断最后一个盘符从而备份进去吗?
Can't we directly determine the last drive letter to back it up?
|
|
2006-12-29 11:05 |
|
|
everest79
金牌会员
      一叶枝头,万树皆春
积分 2564
发帖 1127
注册 2006-12-25
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
不知道ghost有没有这样的参数
I don't know if ghost has such a parameter
|
|
2006-12-29 11:15 |
|
|
zahy006
初级用户
 
积分 69
发帖 23
注册 2006-12-7
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
刚才看了很多方法,也试过了,除了斑竹的findcd之外(下载不了)有没有人能帮忙编一下。。。拜托了各位……
只要能判断最后一个盘符就行…………
Just now I've seen many methods and tried them. Except for the moderator's findcd (can't download), is there anyone who can help compile... Please everyone... As long as it can judge the last drive letter...
|
|
2006-12-29 13:20 |
|
|
hhwwll
中级用户
  
积分 293
发帖 30
注册 2003-9-1
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
@echo off
REM 判断硬盘最后FAT分区盘符
set na=
set dif=
func -a6 >>dtemp.txt
STRINGS na=LINESIZE dtemp.txt
STRINGS dif=READ dtemp.txt,%na%
echo %dif%
@echo off
REM Determine the drive letter of the last FAT partition on the hard disk
set na=
set dif=
func -a6 >>dtemp.txt
STRINGS na=LINESIZE dtemp.txt
STRINGS dif=READ dtemp.txt,%na%
echo %dif%
|
|
2006-12-29 13:39 |
|
|
everest79
金牌会员
      一叶枝头,万树皆春
积分 2564
发帖 1127
注册 2006-12-25
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
你用ghost的话它自带了一个工具是可以显示分区的,GDISK.EXE
gdisk 1 显示第一块硬盘分区信息,你可以此来检索
If you use Ghost, it has a built-in tool called GDISK.EXE. gdisk 1 displays the partition information of the first hard disk, and you can use this to retrieve.
|
|
2006-12-29 13:54 |
|
|
ccwan
金牌会员
     
积分 2725
发帖 1160
注册 2006-9-23 来自 河北廊坊
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
用论坛搜索,能找到好多这样的帖子,多看一下开拓思路吧。
好多都是已结的帖子了。
Using the forum search, you can find many such posts. Take a look more to expand your ideas. Many are already closed posts.
|

三人行,必有吾师焉。 学然后知不足,教然后知困,然后能自强也。 |
|
2006-12-29 21:05 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
Originally posted by zahy006 at 2006-12-29 11:05:
难道不能直接判断最后一个盘符从而备份进去吗?
二楼已经讲过了,ghost只认分区号,不认盘符,除非你全是FAT格式(很显然,这是不可能的)。
我参考别人的批处理,解决办法是,
1,DOS运行ghost -dd,取得第一硬盘的最后分区号(我是只找第一硬盘),
2,然后运行ghost行命令。
Originally posted by zahy006 at 2006-12-29 11:05:
Can't we directly determine the last drive letter to back it up?
The second floor has already said that Ghost only recognizes partition numbers, not drive letters, unless all are FAT formats (obviously, this is impossible).
I refer to others' batch scripts, and the solution is,
1. Run Ghost -dd in DOS to get the last partition number of the first hard drive (I am only looking for the first hard drive),
2. Then run the Ghost command.
|

Windows 一键还原
http://www.yjhy.com |
|
2006-12-29 21:09 |
|
|
不得不爱
超级版主
         我爱DOS
积分 5310
发帖 2044
注册 2005-9-26 来自 四川南充
状态 离线
|
|
2006-12-29 21:16 |
|