Board logo

标题: 菜鸟求助 [打印本页]

作者: ffhh     时间: 2007-1-14 16:14    标题: 菜鸟求助

前提是在DOS下使用
想写一条批处理在dos下使用。 先搜索所有硬盘查找ghost.exe,然后列出所有ghost.exe所在目录。 保存为ghostcd.txt然后附值到一个变量%ghostcd%。做出判断,使用哪个ghost文件。例如第一个ghost.exe文件所在路径如 (d:\tools\ghost\ghost)判断是否使用不使用的话将ghostcd.txt第2行引入。直到没有文字为止。
搜索所有硬盘查找ghost.exe我已经写好了
For %%f in (w v u t s r q p o n m l k j i h g f e d c) Do dir/s %%f:\ghost.exe >>1.txt
结果是

Volume in drive E is SUPER

Directory of E:\SIMPCHIN\TOOLS\GHOST

GHOST    EXE     1,394,212  10-22-03  14:46
         1 file(s)      1,394,212 bytes

Total files listed:
         1 file(s)      1,394,212 bytes
         0 dir(s)               0 bytes free

Volume in drive D has no label
Volume Serial Number is 0000-8323

Directory of D:\TOOLS\GHOST

GHOST    EXE     1,394,212  10-22-03  14:46
         1 file(s)      1,394,212 bytes

Total files listed:
         1 file(s)      1,394,212 bytes
         0 dir(s)       16,357.75 MB free

Volume in drive C has no label
Volume Serial Number is BCBD-854A

Directory of C:\

                        16,255.81 MB free
我想去掉其他没用的部分生成内容如下的ghostcd.txt
E:\SIMPCHIN\TOOLS\GHOST
D:\TOOLS\GHOST
将每行带入批处理作出选择也不知道怎么写望大家指点12

[ Last edited by ffhh on 2007-1-14 at 03:18 AM ]