Video Screencast Help
Search Video Help Close Back
to help
Not able to make it to Vision this year? Get a sampling in the Best of Vision on Demand group.

Script execution error

Updated: 24 Aug 2010 | 4 comments
BrandonV's picture
0 0 Votes
Login to vote
This issue has been solved. See solution.

Hello All

I've got a script that runs when a client boots through PXE and connects to the DS server. When the script runs it fails and generates an error

Error -2147467263

If I run the content of the script manually it doesn't generate any errors...

Any ideas please?

I'm running DS 6.9 SP3

Comments

mclemson's picture
21
Apr
2010
1 Vote +1
Login to vote

What is the content of your script?

Are you able to post your script?  What operating system is this script run on?  By manually, do you mean that you run the script from Windows and it works fine, but that when you're in a pre-boot environment (non-Windows) it doesn't work?

Mike Clemson, Senior Systems Engineer
Intuitive Technology Group -- Symantec Platinum Partner

BrandonV's picture
22
Apr
2010
0 Votes 0
Login to vote

This all happens when the

This all happens when the clients have booted into WinPE. I use a start /wait command to write in the instructions to test them and then I create a job and paste in the instructions.

The first line is
cscript.exe .\Servers\W2K8\AMD64bit\InjectDriversOffline.vbs amd64 %MOUNT_POINT%:\drivers v:\WAIK


Content of the InjectDriversOffliine.vbs is
'Inject drivers
'vbscript
' Shell object
set sh = WScript.CreateObject("WScript.Shell")
' File System object
set fso = WScript.CreateObject("Scripting.FileSystemObject")
' Network object
set objNet = WScript.CreateObject("WScript.Network")
 

'strLocationOfWIMFile = wscript.Arguments(0)
'strLocationtoMountWIMFile = wscript.Arguments(1)
strProcessorWIMArchitecture = wscript.Arguments(0)
strLocationofMassStoragePNPDevices = wscript.Arguments(1)
strLocationofWAIK = wscript.Arguments(2)
'set some local variables
Processor_architecture = sh.ExpandEnvironmentStrings("%Processor_architecture%")
TMPFolderArea = sh.ExpandEnvironmentStrings("%TMP%")
strLocationofImageXFiles = strLocationofWAIK & "\tools\" & Processor_architecture  
'Check that the mount location exists, if it does not, then try and created it
Mount_Point = sh.ExpandEnvironmentStrings("%MOUNT_POINT%")

'Check the folder that contains the Mass Storage Device Drivers exists
if not fso.folderexists (strLocationofMassStoragePNPDevices) then
 msgbox "The Mass storage device driver folder: " & strLocationofMassStoragePNPDevices & " does not exist"
 wscript.quit
end if

'Check if the WIM file exists
'if not (fso.fileexists (strLocationOfWIMFile)) then
' msgbox ("The Image file: " & strLocationOfWIMFile & chr(13) & "Does not exist!")
' wscript.quit
'end if
'check to see if the location of the packagemanager exists
strPackageManagerEXE = strLocationofWAIK & "\Tools\" & Processor_architecture & "\servicing\pkgmgr.exe"
if not (fso.fileexists (strPackageManagerEXE)) then
 msgbox ("The Pkgmgr does not exist at: " & strPackageManagerEXE & chr(13) & " Does not exist!")
 wscript.quit
end if
'Now create a temporary XML file that contains the required
if (fso.fileexists(TMPFolderArea & "\updateDrvs.xml")) then
 on error resume next
  fso.deletefile(TMPFolderArea & "\updateDrvs.xml")
  if err.number <> 0 then
   msgbox ("Cannot delete the file: " & TMPFolderArea & "\updateDrvs.xml")
   wscript.quit
  end if
 on error goto 0
end if

 
set txt = fso.createtextfile(TMPFolderArea & "\updateDrvs.xml", true)
txt.writeline ("<?xml version="& chr(34) & "1.0"& chr(34) & " encoding="& chr(34) & "utf-8"& chr(34) & "?>")
txt.writeline ("<unattend xmlns="& chr(34) & "urn:schemas-microsoft-com:unattend"& chr(34) & ">")
txt.writeline ("   <settings pass="& chr(34) & "offlineServicing"& chr(34) & ">")
txt.writeline ("        <component name="& chr(34) & "Microsoft-Windows-PnpCustomizationsNonWinPE"& chr(34) & " processorArchitecture="& chr(34) & strProcessorWIMArchitecture & chr(34) & " publicKeyToken="& chr(34) & "31bf3856ad364e35"& chr(34) & " language="& chr(34) & "neutral"& chr(34) & " versionScope="& chr(34) & "nonSxS"& chr(34) & " xmlns:wcm="& chr(34) & "http://schemas.microsoft.com/WMIConfig/2002/State"& chr(34) & " xmlns:xsi="& chr(34) & "http://www.w3.org/2001/XMLSchema-instance"& chr(34) & ">")
txt.writeline ("            <DriverPaths>")
txt.writeline ("                <PathAndCredentials wcm:action="& chr(34) & "add"& chr(34) & " wcm:keyValue="& chr(34) & "1"& chr(34) & ">")
txt.writeline ("                    <Path>" & strLocationofMassStoragePNPDevices &"</Path>")
txt.writeline ("                </PathAndCredentials>")
txt.writeline ("            </DriverPaths>")
txt.writeline ("        </component>")
txt.writeline ("    </settings>")
txt.writeline ("</unattend>")
txt.close

on error goto 0

'Run the Package Command, and regardless of the result, unmount the WIM Image
errored = false
PkgMgrCommand = chr(34) & strLocationofWAIK & "\Tools\" & Processor_architecture & "\servicing\pkgmgr.exe" & chr(34) & " /n:" & chr(34) & TMPFolderArea & "\updateDrvs.xml" & chr(34) & " /o:" & Mount_Point & ":;" & Mount_Point & ":\windows /norestart /l:" & chr(34) &  TMPFolderArea & "\UpdateDrivers.log" & chr(34)

set txt = fso.createtextfile(TMPFolderArea & "\updateDrvs.cmd", true)
txt.writeline ( PkgMgrCommand )
txt.close

*************************************************************************************************************************************

Then a few other lines run and then I have
x:
x:\windows\temp\updatedrvs.cmd

When I use the line below in one job it completes with a succes
cscript.exe .\Servers\W2K8\AMD64bit\InjectDriversOffline.vbs amd64 %MOUNT_POINT%:\drivers v:\WAIK

I then have another job that runs the lines below but it fails
x:
x:\windows\temp\updatedrvs.cmd

So I'm trying to establish why the updatedrvs.cmd command fails

 

BrandonV's picture
22
Apr
2010
0 Votes 0
Login to vote

(No subject)

By the way I should add that VB script was written by someone else to update a 2008 R1 image.

I'm trying to use the same script for a 2008 R2 image and I think the xml file that is being created within the script may need to be in a different format.

BrandonV's picture
22
Apr
2010
0 Votes 0
Login to vote

Right, Looks like I have a

Right,

Looks like I have a solution.

The script is fine however the xml file that it creates is different to one that is created with WAIK 7 so that needed to be corrected.

Lasty the PKGMGR.exe that i had seemed a little out of date. I took the exe from a 2008 R2 server and I'm using that instead.

It's worth noting that MS now want us to use DISM.exe for in 7 and 2008 R2