在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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值