微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在winpe中使用sdimgr发布xpe的image

今天按照msdn上的文档,制作了windows embedded的可运行image,并打包成sdi文件

然后用winpe启动虚拟机,试图用sdimgr命令提取sdi中的image;结果是运行sdimgr失败,提示不是可执行程序。

后来发现winpe认是不支持脚本的,而如果要通过winpe发布image,最好是制作一个支持脚本的customized的winpe。

在google上找到了以下文档,证明是可行的。

http://www.droppedpackets.org/osd/vbscript-in-winpe

终于可以给给人演示一把了。

原文引用如下:

VBScript in WinPE

作者:jbuelens 上次修改时间: 2008-12-22 10:37 贡献人:jack Extending the preboot environment's capabilities Before you start,are you sure you want VBScript? If you have existing VB scripts that you want to use under WinPE,then yes,read on. But if you just wanted to do some scripting and you don't have a vested interest in VB,have a look at AutoIt first. Download Autoit from http://www.autoitscript.com (it is freeware). Autoit is similar to vb script and anybody who feels comfortable editing a vb script is likely to feel equally comfortable editing an Autoit script. But in contrast with vb,an Autoit script can be compiled and run as a small self-contained executable,with no need for run-time DLLs. If you do want VB Scripting support,here is how to include it in your existing WinPE image: 1. On your core server,use WinImage to open the WinPE image file (in a default install,this is C:/Program Files/LANDesk/ManagementSuite/landesk/vboot/ldvpe1.img) 2. copy these 12 files from a Win2003 SP1 server’s system32 folder to WinPE’s /i386/system32: cscript.exe,jscript.dll,mlang.dll,scrobj.dll,scrrun.dll,stdole2.tlb,vbscript.dll,wscript.exe,wshext.dll,wshom.ocx,odbc32.dll,odbcint.dll 3. copy this file from a Win2003 SP1 server’s windows/inf folder to WinPE’s /i386/system32: wsh.inf 4. Create /i386/system32/oc.bat with the following content: @ECHO OFF START "Installing Components" /MIN OC2.bat 5. Create /i386/system32/oc2.bat with the following content: REM - INSTALL WSH COMPONENTS regsvr32 %systemRoot%/System32/jscript.dll /S regsvr32 %systemRoot%/System32/scrobj.dll /S regsvr32 %systemRoot%/System32/scrrun.dll /S regsvr32 %systemRoot%/System32/vbscript.dll /S regsvr32 %systemRoot%/System32/wshext.dll /S regsvr32 %systemRoot%/System32/wshom.ocx /S regsvr32 %systemRoot%/System32/mlang.dll /S REM - INSTALL FILE ASSOCIATIONS FOR WSH %systemRoot%/System32/rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 WSH.inf EXIT 6. Insert the following line in /i386/system32/startnet.cmd: (where? Not critical – suggest after “factory –winpe”) call oc.bat 7. Save the ldvpe1.img image. 8. Redeploy your PXE representatives. Rather than building a new WinPE image that includes VB Scripting,you might just add scripting support on-the-fly. You use the out-of-the-Box WinPE image and you include REMEXEC lines in your OSD script that copy and register the necessary files. Use the same instructions as above (excluding items 1 and 6-7 of the list),but use REMEXEC lines in your OSD script,or equivalent actions in your provisioning template,to copy the files and run the OC.bat file. If there is any danger of running out of space,here are 3 files that you can safely delete from the i386/system32: winpe.bmp,ntoskrnl.exe,ntkrnlmp.exe. These files must be there at boot time (do not delete them from the WinPE image!). But once WinPE is running,it is safe to delete them. There is a cost to adding the files on-the-fly: 2.4 MB to be copied,presumably from the core server. If it is important to avoid that cost,go back to plan A and include the files in the image.

原文地址:https://www.jb51.cc/vb/262669.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐