中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
作者:
标题: 菜鸟求助 上一主题 | 下一主题
ffhh
新手上路





积分 8
发帖 2
注册 2006-12-12
状态 离线
『楼 主』:  菜鸟求助

前提是在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 ]

2007-1-14 16:14
查看资料  发送邮件  发短消息 网志   编辑帖子  回复  引用回复

请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: