12 Replies Latest reply on Jan 19, 2009 9:45 AM by jan.buelens

    Scripting support in WinPE?

    Apprentice

      Good morning,

       

      Can anyone tell me offhand if the PE boot image that comes with 8.7 sp4 has built-in support for VBScript?  I have the HII document which tells how to inject the files to support it but wasn't sure at what point/service pack it came stock, if at all.  Also does the 8.8 PE boot image support it off the shelf?

       

      Thanks.

        • 1. Re: Scripting support in WinPE?
          phoffmann SupportEmployee

          Not sure about the VBScript side of things - but the WinPE image used in 8.8 is not really much different to 8.7 - the next major changes regarding WinPE are being worked on at the moment.

           

          Haven't tried throwing vbscript's into 'em yet - what is it you're trying to do? Give it a whirl and try - I'm not 100% sure if the interpreter is still in the image (I think so).

           

          Paul Hoffmann

          LANDesk EMEA Technical Lead.

          • 2. Re: Scripting support in WinPE?
            zman Master

            Easiest way to add scripting into winpe http://www.autoitscript.com/autoit3/ 

            • 3. Re: Scripting support in WinPE?
              Rookie

              The winpe image doesn't support VBscript and XML both should be injected in the WinPE image.

               

              We call the script in the LAndesk deployment script before the OS depoyment.

               

               

               

              Attached are screenshot of the files which should be copied and the example script for copie and registration it self.

               

               

               

              hope this helps

              • 4. Re: Scripting support in WinPE?
                Apprentice

                Thanks for the responses!

                 

                Phoffman,

                 

                To answer your question, I wrote a little VB app that prompts the user to enter a machine name and a MAC address, saves the data as a .IMS file and moves it to the LDSCAN directory on the core to be added to the DB.  I just finished our HII image and I hope to let this app run before OSD injects the Sysprep.inf for the particular model.  Basically:

                 

                1.  PXE Boot and select script for model of PC

                2.  VBS App runs prompting user to enter Device Name and MAC address, creating record in LDDB

                3.  tokrepl injects machine name into sysprep.inf before image reboots

                4.  Machine boots to mini-setup, enumerates HII drivers etc., adds to Active Directory, installs default agent and comes up fully configured

                 

                I suppose I could skip the creation of the .IMS and just have the VB write directly to Sysprep.inf, but hey I already did the script.    This are the basics of what I'm shooting for.

                • 5. Re: Scripting support in WinPE?
                  phoffmann SupportEmployee

                  If it's just about names - you could make your life a lot easier up-front with a simple use of CSV-import.

                   

                  Hardware vendors just provide you with the MAC-addresses, you create mini-scan files easily, and it runs all automatically ...? :).

                   

                  No need for end-user input that way :).

                   

                  Paul Hoffmann

                  LANDesk EMEA Technical Lead.

                  • 6. Re: Scripting support in WinPE?
                    Apprentice

                    100% agree with you PHoffman.    I use CSVImport currently and it does work fine.  However, we currently have issues getting MAC addresses ahead of time from our vendor (Gateway/MPC).  They don't publish the MAC on the outside of their boxes.  If they did I wouldn't have a need for the tool I wrote.  I could pre-pop every box into LD ahead of time.  As it stands now we have to boot every box to get the MAC. 

                     

                    In comes my VB app.  The user doing the PXE boot gets prompted just after the image is run in PE to enter Device Name and MAC.  They can get the MAC from within PE, or I may be able to automate that via VB.  This also comes in handy when a motherboard is replaced in the field to create a new record in LDDB.

                    • 7. Re: Scripting support in WinPE?
                      phoffmann SupportEmployee

                      Ah - I see ...

                       

                      ... in that case, OK, it makes sense.

                       

                      But yeah, in this case, should be easy enough to add it to the WinPE image as per above commentary, or use AutoIT - potentially better still as you can simply point the script to download your file from location X and can in this way future-proof it, independent of VBScript, but personal preference applies as usual :).

                       

                      Paul Hoffmann

                      LANDesk EMEA Technical Lead.

                      • 8. Re: Scripting support in WinPE?
                        Apprentice

                        By the way, is it wrong to love a piece of software?  AutoIT is quickly becoming one of my favorites.  Saved me a lot of time.  Thanks Zman

                        • 9. Re: Scripting support in WinPE?
                          Jared Barneck SupportEmployee

                          They have to put something on the Box. The serial number or something.  You can match that to a MAC address.  I have never seen the box come without any data that can be used.

                          • 10. Re: Scripting support in WinPE?
                            Apprentice

                            Rhyous,

                             

                            They do put the Serial Number on the box.  Problem is scans don't always capture the serial number correctly.  So the MAC is the only accurate piece of info I have at this point in the process.  Plus it can be validated by the user rather than relying on the scan to report correct data.  This becomes a problem in HII as well; quite a few machines, all the same model, report back a different model or version number to the LDDB than they should so creating a universal script to go with a Hardware Independent Image becomes very tedious and not all that universal anymore.

                             

                            That said, if Gateway/MPC would put the MAC address on the boxes they ship in I wouldn't need the tool.  OK, I'll quit whining now. 

                            • 11. Re: Scripting support in WinPE?
                              ahe Expert

                               

                              Here you can find some hints to embed WMI and VBScript into the image:

                               

                               

                              Hardware Independent Imaging using LANDesk OSD - rev 9.1

                               

                               

                              Windows PreInstallation Environment (WinPE) Whitepaper

                               

                               

                               

                               

                               

                              Regards

                              Axel

                               

                               

                               

                               

                               

                              • 12. Re: Scripting support in WinPE?
                                Employee

                                The HII document referred to above has been revised and no longer describes how to add vb scripting support to the WinPE image.

                                 

                                If you want vb scripting support, there is a how-to document titled VBScript in WinPE in the OSD section of droppedpackets.org.

                                 

                                But before you decide to use vb scripting, consider using AutoIt instead. Autoit is similar to vb script. If you feel comfortable editing a vb script, you are 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.