无忧启动论坛

 找回密码
 注册
搜索
系统gho:最纯净好用系统下载站广告联系 微信:wuyouceo QQ:184822951
查看: 3498|回复: 8
打印 上一主题 下一主题

[讨论] chiannet 你PE里的面的那个用于IMage右键菜单的批处理好像有点问题

[复制链接]
跳转到指定楼层
1#
发表于 2015-8-26 21:38:42 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
你的8 PE里面  用于IMAGEX右键菜单的  MOUNT.CMD  好像 有点问题:


     当对WIM 解包到磁盘安装时,调用 :input 子菜单:


  1. :input
  2. set input=
  3. set /p input=〉〉〉→
  4. if defined input (
  5.     set "input=!input:"=!"
  6.     call :input_1 "%~1"
  7.     if defined input goto :eof
  8. )
  9. if /i "%~1"=="skip" goto :eof
  10. goto %0

复制代码

因为开了变量延时会造成  :mbr  在对WIM文件解包到磁盘分区 时  !input!附值 变成 skip? (?=真实的变量值)

  1. :mbr
  2. if /i not "%~1"=="/applyto" (if /i not "%~1"=="/refto" goto :eof)
  3. if not "%~p2"=="" goto :eof
  4. echo.&echo         输入“5”写入 NT5 引导,输入“6”写入 NT6 引导,输入其它跳过:&echo.
  5. call :input skip
  6. set bootsect=
  7. if exist "%Windir%\system32\bootsect.exe" (set bootsect=bootsect.exe) else (
  8.         if exist y:\32B_APP\CGI\bootsect.exe (set bootsect=y:\32B_APP\CGI\bootsect.exe) else (
  9.          if exist y:\X64_APP\CGI\bootsect.exe (set bootsect=y:\X64_APP\CGI\bootsect.exe) else (if not exist "%~dp0bootsect.exe" goto :eof)))
  10. if not defined bootsect set bootsect=bootsect.exe
  11. rem 假如输入5 此时变量的附值会变成 skip5            
  12. if "!input!" equ  "5" !bootsect! /NT52 %~d2
  13. rem 假如输入6 此时 !input! 等于Skip6
  14. if "!input!" equ "6" !bootsect! /NT60 %~d2
  15. goto :eof
复制代码


因为  :input  没有注意处理这个问题
建议更改为

  1. :input
  2. set input=
  3. set /p input=〉〉〉→
  4. if defined input if /i "%~1"=="skip" goto :eof
  5. if defined input (
  6.     set "input=!input:"=!"
  7.     call :input_1 "%~1"
  8.     if defined input goto :eof
  9. )
  10. goto %0
复制代码


此外  mbr 的修改建议加强  在没有BOOTsect.exe 建议调用 BOOTice.exe

  1. :mbr
  2. if /i not "%~1"=="/applyto" (if /i not "%~1"=="/refto" goto :eof)
  3. if not "%~p2"=="" goto :eof
  4. echo.&echo         输入“5”写入 NT5 引导,输入“6”写入 NT6 引导,输入其它跳过:&echo.
  5. call :input skip
  6. set bootsect=
  7. if exist "%Windir%\system32\bootsect.exe" (
  8.         set bootsect=bootsect.exe
  9.         if "!input!" equ "5" bootsect.exe /NT52 %~d2
  10.         if "!input!" equ "6" bootsect.exe /NT60 %~d2
  11. )

  12. rem  这是我自己WIN7BOOTice  的位置,你直载把这里改成你PE 附件里BOOTICE.exe 位置就行了
  13. if not defined bootsect (
  14.         if exist %~dp0..\BOOTICEx86.exe (
  15.                 if "!input!" equ "5"  ..\BOOTICEx86.exe /DEVICE=%~d2 /pbr /install /type=ntldr /boot_file=NTLDR
  16.                 if "!input!" equ "6"  ..\BOOTICEx86.exe /DEVICE=%~d2 /pbr /install /type=bootmgr /boot_file=BOOTMGR
  17.         )
  18. )
  19. goto :eof
复制代码

2#
 楼主| 发表于 2015-8-26 21:47:36 | 只看该作者
还有 7z 的注册会造成 8PE 双击VHD 挂载功能失效
建议把 7z 对 .vhd  的注册表修改清除掉。或者用
  1. assoc  .vhd=windows.vhdfile
复制代码
来修复对.vhd的 双击挂载。

回复

使用道具 举报

3#
发表于 2015-8-26 23:32:28 | 只看该作者
论坛不能缺少你!3Q
回复

使用道具 举报

4#
发表于 2015-8-27 09:52:18 | 只看该作者
好强大啊,批处理啊!!!
回复

使用道具 举报

5#
发表于 2015-8-27 10:13:56 | 只看该作者
膜拜大神啊
偶这个菜鸟脚本都不会写
回复

使用道具 举报

6#
发表于 2015-8-27 10:23:15 | 只看该作者
太利害了!!!!!
回复

使用道具 举报

7#
 楼主| 发表于 2015-8-27 11:24:17 | 只看该作者
野狼无忧 发表于 2015-8-27 10:13
膜拜大神啊
偶这个菜鸟脚本都不会写

系统的学批处理建议  去下载 “批处理之家”的教程。
由浅入深容易懂。
回复

使用道具 举报

8#
发表于 2015-8-27 11:32:39 | 只看该作者
         哎, 我是静不下心好好学学了。
回复

使用道具 举报

9#
发表于 2015-8-28 09:03:07 | 只看该作者
x9tian 发表于 2015-8-27 11:24
系统的学批处理建议  去下载 “批处理之家”的教程。
由浅入深容易懂。

大神居然回复我了,好感动!!!谢谢大神的指导
回复

使用道具 举报

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

本版积分规则

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

闽公网安备 35020302032614号

GMT+8, 2024-9-22 11:43

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

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