无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站投放广告、加入VIP会员,请联系 微信:wuyouceo
查看: 1943|回复: 4
打印 上一主题 下一主题

高手进来。。谁来帮我精简一下这个DOS下的BAT文件

[复制链接]
跳转到指定楼层
1#
发表于 2013-5-7 18:02:50 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 2013lucuan 于 2013-5-8 09:09 编辑

@echo off
goto _%1
goto end

:_fe
func -i%bd%
if errorlevel 100 set errf=GHO 镜像所在硬盘值 %bd% 格式错误
if not "%errf%"=="" goto end
func -i%bp%
if errorlevel 100 set errf=GHO 镜像所在分区值 %bp% 格式错误
if not "%errf%"=="" goto end
func -i%rd%
if errorlevel 100 set errf=接受还原的硬盘值 %rd% 格式错误
if not "%errf%"=="" goto end
func -i%rp%
if errorlevel 100 set errf=接受还原的分区值 %rp% 格式错误
if not "%errf%"=="" goto end
func -i%rd%
if errorlevel 100 set errf=接受备份的硬盘值 %rd% 格式错误
if not "%errf%"=="" goto end
func -i%rp%
if errorlevel 100 set errf=接受备份的分区值 %rp% 格式错误
if not "%errf%"=="" goto end
if "%rar%"=="0" set rar=
if not "%rar%"=="" func -i%rar%
if errorlevel 100 set errf=压缩率输入值 %rar% 格式错误
if not "%errf%"=="" goto end
if "%sp%"=="" set sp=0
func -i%sp%
if errorlevel 100 set errf=分卷大小值 %sp% 格式错误
if not "%errf%"=="" goto end
goto end

:_ge
set gherrn=未知错误,程序无法继续
if "%errn%"=="(36002)" set gherrn=用户中断操作
if "%errn%"=="(36000)" set gherrn=可能分区不存在
if "%errn%"=="(30004)" set gherrn=镜像文件有密码
if "%errn%"=="(19080)" set gherrn=存取目录或文件名无效
if "%errn%"=="(19000)" set gherrn=程序的执行参数有误
if "%errn%"=="(16040)" set gherrn=硬盘上分区太多
if "%errn%"=="(15175)" set gherrn=来源硬盘分区有错
if "%errn%"=="(15170)" set gherrn=来源硬盘分区无效
if "%errn%"=="(12090)" set gherrn=存取硬盘发生错误
if "%errn%"=="(11032)" set gherrn=存放镜像空间已满
if "%errn%"=="(10010)" set gherrn=镜像文件不存在
if "%errn%"=="(10008)" set gherrn=镜像文件已损坏
if "%errn%"=="(10001)" set gherrn=用户中断操作
if "%errn%"=="(662)" set gherrn=路径错误不存在
if "%errn%"=="(657)" set gherrn=没有足够空间保存镜像
if "%errn%"=="(651)" set gherrn=不能定位镜像分卷
if "%errn%"=="(519)" set gherrn=没有足够空间保存镜像
goto end

:_pt
echo 盘号 盘符  活动 格式         总大小mb  卷标(隐藏)>%text%
type pinfo.okg>>%text%
echo 请按任意键返回. . .>>%text%
goto vtm

:_st
set ST=请选择要操作的分区
goto end

:_bt
set BT=选择搜索到的 %SType% 文件还原             文件大小  创建日期
goto end

:_rfs
type search.okg>%text%
goto vtm

:_as
echo 正在搜索第   硬盘第   分区的 %SType% 文件,请稍候...>%text%
set fsds=9,27
set fsps=9,36
goto vtm

:_lst
type %temp%\okg_sp.tmp>%text%
goto vtm

:_rs
set rs=重启
if "%rsn%"=="2" set rs=关机
goto end

:_main
echo :main "%Title% 主菜单" [X]>%text%
echo.>>%text%
echo    [  &R. 系 统 一 键 还 原  ]>>%text%
echo.>>%text%
echo    [  &B. 系 统 一 键 备 份  ]>>%text%
echo ────────────────>>%text%
echo    [  3. 自 定 义 操 作 项  ]>>%text%
echo.>>%text%
echo    [  4. 搜 索 GHO 高 级 项 ]>>%text%
echo.>>%text%
echo    [  5. 手 动 GHOST 操 作  ]>>%text%
echo.>>%text%
echo    [  6. DOS 命 令 行 操 作 ]>>%text%
echo.>>%text%
echo    [  7. 重 启 本 计 算 机  ]>>%text%
echo ━━━━━━━━━━━━━━━━>>%text%
echo                       [英文(&E)]>>%text%
goto vtm

:_ghostr
echo :ghostr "%Title% 还原确认" [X]>%text%
echo.>>%text%
echo 把第 ~%bd%~ 硬盘第 ~%bp%~ 分区:\%gn% 镜像>>%text%
echo.>>%text%
echo ~~ 还原 ~~到第 ~%rds%~ 硬盘第 ~%rps%~ 分区>>%text%
echo.>>%text%
echo 完成关机:[!]  NOUSB:[!]  NOIDE:[!]>>%text%
echo.>>%text%
echo 若要还原其他分区请选择 3. 自定义操作项>>%text%
echo.>>%text%
echo [确定(&O)] [?取消(&C)] [分区信息(&P)]>>%text%
goto vtm

:_gherr1
echo :gherr1 "%Title% 分区未通过检测" [X]>%text%
echo.>>%text%
echo 第~1~硬盘只有~1~个常规分区,GHOST 至少需要~2~个常规分区!>>%text%
echo.>>%text%
echo 如果有~2~个以上硬盘请选择 ~3、4、5~ 操作项>>%text%
echo.>>%text%
echo [返回(&R)]>>%text%
goto vtm

:_gherr2
echo :gherr2 "%Title%" [X]>%text%
echo.>>%text%
echo 第 %sds% 硬盘第 %sps% 分区,没有找到 %SType% 文件!>>%text%
echo.>>%text%
echo [返回(&R)] [深层搜索(&D)] [高级搜索(&A)]>>%text%
goto vtm

:_gherr3
echo :gherr3 "%Title%" [X]>%text%
echo.>>%text%
echo 搜索已完成,没有发现任何 %SType% 文件!>>%text%
echo.>>%text%
echo [返回(&R)]>>%text%
goto vtm

:_gherr4
echo :gherr4 "%Title% 发现错误" [X]>%text%
echo.>>%text%
echo %gherrn%!>>%text%
echo.>>%text%
echo [确定(&O)]>>%text%
goto vtm

:_gherr5
echo :gherr5 "%Title% 发现错误" [X]>%text%
echo.>>%text%
echo %errf%!请返回重新输入>>%text%
echo.>>%text%
echo [确定(&O)]>>%text%
goto vtm

:_ghokm
echo :ghokm "%Title% 操作完成" [X]>%text%
echo.>>%text%
echo 本次操作已完成!~#?~秒后自动%rs%!>>%text%
echo.>>%text%
echo [重启(&R)] [关机(&S)] [?取消(&C)]>>%text%
goto vtm

:_ghostb
echo :ghostb "%Title% 备份确认" [X]>%text%
echo.>>%text%
echo 把第 ~%rds%~ 硬盘第 ~%rps%~ 分区~~ 备份 ~~到>>%text%
echo.>>%text%
echo 第 ~%bds%~ 硬盘第 ~%bps%~ 分区:\%gbfile%>>%text%
echo.>>%text%
echo 完成关机:[!]  NOUSB:[!]  NOIDE:[!]  压缩1-9:([$rar,1])>>%text%
echo.>>%text%
echo 若要还原其他分区请选择 3. 自定义操作项>>%text%
echo.>>%text%
echo [确定(&O)] [?取消(&C)] [分区信息(&P)]>>%text%
goto vtm

:_ghostbs
echo :ghostbs "%Title% 覆盖提示" [X]>%text%
echo.>>%text%
echo 第 ~%bds%~ 硬盘第 ~%bps%~ 分区:\%FileE%>>%text%
echo.>>%text%
echo ~镜像文件已存在,继续将被覆盖掉!~>>%text%
echo.>>%text%
echo [确定(&O)] [?取消(&C)]>>%text%
goto vtm

:_search
echo :search "%Title% 高级搜索" [X]>%text%
echo.>>%text%
echo 目录层: ~1~[.]  ~2~[.]  ~n~[.] "n"表示所有目录>>%text%
echo.>>%text%
echo 扩展名: [$su,3]  跳过系统盘搜索:[!]>>%text%
echo.>>%text%
echo [自动搜(&A)] [手动搜(&M)] [?取消(&C)]>>%text%
goto vtm

:_ghostrm
echo :ghostrm "%Title% 自定义还原" [X]>%text%
echo.>>%text%
echo [&R. 还原自定操作]   [&B. 备份自定操作]>>%text%
echo ────────────────────────────>>%text%
echo.>>%text%
echo 把第 [$bd,1] 硬盘第 [$bp,1] 分区:\[$gn,80              ]  [搜索(&F)]>>%text%
echo.>>%text%
echo ~~ 还原 ~~到第 [$rd,1] 硬盘第 [$rp,1] 分区  [选择分区(&S)]>>%text%
echo.>>%text%
echo 完成关机:[!]  NOUSB:[!]  NOIDE:[!]>>%text%
echo.>>%text%
echo ━━━━━━━━━━━━━━━━━━━━━━━━━━━━>>%text%
echo [确定(&O)] [重置(&T)] [?取消(&C)] [分区信息(&P)]>>%text%
goto vtm

:_Cuserr1
echo :Cuserr1 "%Title%" [X]>%text%
echo.>>%text%
echo 备份或还原的分区与镜像所在的分区不能相同!>>%text%
echo.>>%text%
echo [返回(&R)]>>%text%
goto vtm

:_Cuserr2
echo :Cuserr2 "%Title%" [X]>%text%
echo.>>%text%
echo 扩展名错误,扩展名只能为 GHO>>%text%
echo.>>%text%
echo [返回(&R)]>>%text%
goto vtm

:_ghostbm
echo :ghostbm "%Title% 自定义备份" [X]>%text%
echo.>>%text%
echo [&R. 还原自定操作]   [&B. 备份自定操作]>>%text%
echo ─────────────────────────────>>%text%
echo.>>%text%
echo 把第 [$rd,1] 硬盘第 [$rp,1] 分区~~ 备份 ~~到  [选择分区(&S)]>>%text%
echo.>>%text%
echo 第 [$bd,1] 硬盘第 [$bp,1] 分区:\[$gn,30              ]  [选择分区(&P)]>>%text%
echo.>>%text%
echo 压缩1-9:([$rar,1])  分卷值:([$sp,4])MB ("0"表示不分卷)>>%text%
echo.>>%text%
echo 完成关机:[!]  NOUSB:[!]  NOIDE:[!]  密码保护:[!]>>%text%
echo.>>%text%
echo ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━>>%text%
echo [确定(&O)] [重置(&T)] [?取消(&C)] [分区信息(&I)]>>%text%
goto vtm

:_ghpar
echo :ghpar "%Title% 禁用设备" [X]>%text%
echo.>>%text%
echo [!] ~-NOUSB~   禁用访问 USB 设备>>%text%
echo.>>%text%
echo [!] ~-NOIDE~   禁用访问 IDE 设备>>%text%
echo.>>%text%
echo [!] ~-NO1394~  禁用访问 1394 设备>>%text%
echo.>>%text%
echo [!] ~-NOSCSI~  禁用访问 SCSI 设备>>%text%
echo.>>%text%
echo [确定(&O)]>>%text%
goto vtm

:_dosapi
echo :dosapi "%Title% DOS扩展接口" [X]>%text%
echo.>>%text%
echo 载入自定 DOS 扩展工具>>%text%
echo.>>%text%
echo [是(&Y)] [否(&N)]>>%text%
goto vtm

:_h
echo.>%text%
echo    ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓>>%text%
echo    ┃                        %Title%                             ┃>>%text%
echo    ┣━━━━┯━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫>>%text%
echo    ┃系统命令│Attrib  Del  Copy  Dir  Md  Cd  Rd  Ren                     ┃>>%text%
echo    ┠────┼──────────────────────────────┨>>%text%
echo    ┃磁盘维护│Ghost                                                       ┃>>%text%
echo    ┠────┼──────────────────────────────┨>>%text%
echo    ┃增强命令│GO  Deltree  Delen  XCopy  Ntfs  UNtfs  Find  Doslfn        ┃>>%text%
echo    ┠────┴──────────────────────────────┨>>%text%
echo    ┃ 软盘=a:  虚拟盘=%RamDrive%                M=返回菜单  R=重启  S=关机  H=帮助 ┃>>%text%
echo    ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛>>%text%
echo.>>%text%
call %vtm% /t %text%
goto end

:vtm
call %vtm% /t %text%>%text%t
goto end

:end


上面是BAT文件内容,我的目的是只留第四项(4. 搜 索 GHO 高 级 项 )
就是运行这个文件后就能够自动搜索硬盘和U盘的GHO文件。你们只要帮我去掉其它功能,只留这个功能。
这个功能非常实用。这个是一个IMG文件,我把里面的BAT文件解压出来的。这个功能非常好,可以自动搜索硬盘和U盘里的GHO文件上,并还原。装系统最好用了。
2#
发表于 2013-5-7 19:53:03 来自手机 | 只看该作者
自己做盘吧,手动输入命令
回复

使用道具 举报

3#
 楼主| 发表于 2013-5-8 09:09:00 | 只看该作者
asqw101451 发表于 2013-5-7 19:53
自己做盘吧,手动输入命令

怎么弄,这个是一个IMG文件,我把里面的BAT文件解压出来的。这个功能非常好,可以自动搜索硬盘和U盘里的GHO文件上,并还原。装系统最好用了。
回复

使用道具 举报

4#
发表于 2013-5-16 13:03:50 | 只看该作者
这个可以下载各位大大的启动盘,之后自己研究下,或上dos联盟,有空的话我把我的盘传上来,你看看
回复

使用道具 举报

5#
发表于 2013-5-22 12:40:37 | 只看该作者
本论坛DOS区有个你需要的命令,全盘搜索某个文件并执行,自己找找吧
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|捐助支持|无忧启动 ( 闽ICP备05002490号-1 )

闽公网安备 35020302032614号

GMT+8, 2025-5-11 21:35

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表