10 Replies Latest reply on Jan 29, 2008 9:26 AM by sevich

    Adding Scripting to WinPE issue



      I'm running 8.7 SP4 and I'm trying to get scripting to work in WinPE.



      I used the buildoptionalcomponents.vbs script to get all the files, added the appropriate files to the system32 and inf directories in the ldvpe.img file and added oc.bat to the startnet.cmd



      When I boot to provisioning and open a console, I can run java script files with no problem, but when I try to run a vbs I get "can't find script engine "VBScript" for script...". I have also tried running this using "cscript script.vbs" and "wscript script.vbs", both with same results.



      I went back and manually ran oc.bat and still could not get it resolved. Since oc.bat really just calls oc2.bat I manually went through executing each line of oc2.bat and I fail registering the following files: scrrun.ddl, vbscript.dll, wshext.dll, wshom.ocx. They all fail to register saying "LoadLibrary ("file") failed - The specified module could not be found"



      Has anyone run in to this before?



        • 1. Re: Adding Scripting to WinPE issue
          zman Master

          Never seen that error. You could try this from dropped packets.



          More specifically:



          +One option is to 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. For detailed

          instructions, see section 5.7.3 of the Hardware Independent Imaging document.+

          • 2. Re: Adding Scripting to WinPE issue

            Essentially that's all I am doing too, the only difference being this says grab it from a 2003 SP1 disc while I grabbed my files from a XP SP2 disc. Think that would play a significant factor? If so I will try rebuilding it will the files off a server disc.

            • 3. Re: Adding Scripting to WinPE issue
              zman Master

              What OS source are you using to build  WinPE? Most seem to use XP. I find that 2003 has more drivers, etc... (personal preference). I would use the same OS XP-XP or 2003-2003.

              1 of 1 people found this helpful
              • 4. Re: Adding Scripting to WinPE issue

                I'm not building WinPE, just injecting the files in to the LANDesk WinPE image ldvpe1.img

                • 5. Re: Adding Scripting to WinPE issue

                  Ok, figured this out. When doing buildoptionalcomponents.vbs, even though it asks for a Windows XP SP2 OR Server2003 SP1 disc, the files are not the same. Did this again using a Server 2003 SP1 disc and it works great! Thanks for your help.

                  • 6. Re: Adding Scripting to WinPE issue
                    zman Master

                    Cool. I always use 2003 seems to work better than XP.

                    • 7. Re: Adding Scripting to WinPE issue


                      Not out of the woods yet. Using the files from the Server disc for WSH helped a little. However, now I am trying to run my script that updates the HAL and I get an error that ActiveX component can't create object: 'WScript.Shell'


                      I went back to running through each command in oc2.bat again to see what is failing. I am getting the same LoadLibrary message now on just scrrun.dll and wshom.ocx. Also getting an error on the last command "rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 WSH.inf" which reads: "Error loading setupapi The specified module could not be found"


                      I am not sure if these 2 dll files and the error for rundll32 are causing my issues running the script, but I would have to think they could be. I also tried copying those 3 files from the XP SP2 disc and got the same results.


                      Any ideas on this one?



                      • 8. Re: Adding Scripting to WinPE issue

                        I had issues with this as well until recently. I was using WinPE with provisioning, and adding the scripting with the on-the-fly method listed in the droppedpackets doc.  Instead of copying each individual file, I had created a zip file, and let it extract to the x:\i386\system32 folder. What I didn't see happening, were the files that were created.


                        I took a look at the files, and they were all created 0 bytes in size (except the first). I tried copying them manually, and i got a message that the destination disk was out of space. That led me to an earlier part of the droppedpackets doc, which said that some files needed to be deleted to make space for the scripting files. I used Provisioning to delete the files listed in the doc, which happen to be  winpe.bmp, ntoskrnl.exe, and ntkrnlmp.exe.




                        After deleting those files, i was able to copy the scripting files over and run a script successfully. The extracting the zip file never worked after that though. I just ended up writing a batch file to delete the files listed above, and copy + install the files from the network.




                        Hope that is more helpful than confusing






                        p.s. the activex error is due to the .dll files being 1)corrupt 2)0 bytes



                        Edit: attached my new oc.bat and oc2.bat.

                        • 9. Re: Adding Scripting to WinPE issue


                          Sorry, hit the wrong button and gave you points instead of replying. Oh well, I guess you get some free ones.



                          I'm actually not doing the on the fly method, I am manually putting the files into the ldvpe1.img file. When provisioning starts, I see that there are 10MB left on the X: drive and all the files that are giving me errors are the correct size. Not sure why these files won't register but it's really putting a damper on my provisioning install.



                          • 10. Re: Adding Scripting to WinPE issue


                            Ok, able to lay this one to rest I believe. In order for those files to properly register, specifically scrrun.dll. You need to copy odbcint.dll and odbc32.dll from a WinPE source to the system32 directory on the ldvpe1.img.



                            I'm good now, thanks for everyones help.



                            As a side note for LANDesk, I'm not sure if it will be included in 8.8, but if it isn't it would be great to have WSH included in the WinPE image right out of the box.