Appending slmgr.log to ztoolkit.log

In phase4 of an ENGL Imaging Toolkit's build process a device is activated using either a MAK key or KMS server. The activation log is driven by slmgr.vbs and saved in a file called c:\ztoolkit\slmgr.log.

For troubleshooting purposes it might be convenient to have this information in ztoolkit.log as well. This little vbscript, to be run in phase4-after.vbs, appends the slmgr.log to ztoolkit.log:

AppendSlmgrLogfile()

Function AppendSlmgrLogfile

  on error resume next

  Set FSO = CreateObject("Scripting.FileSystemObject").OpenTextFile("c:\ztoolkit\slmgr.log",1)
  strSlmgrLogging  = FSO.ReadAll()
  FSO.Close

  Status = Utils.AppendLog("phase4-after.vbs: " & strSlmgrLogging )

  If Err.Number <> 0 then  
    'MsgBox "An error occured in routine AppendSlmgrLogfile()"
    Status = Utils.AppendLog("phase4-after.vbs: " & "AppendSlmgrLogfile()" & " an error occurred " & Err.Number)
  Else
    Status = Utils.AppendLog("phase4-after.vbs: " & "AppendSlmgrLogfile()" & " successfully")
  End If
 
End Function

Tags: ENGL, Novell, ZCM

Add comment