MAKEMSI quickly and reliably creates MSI files in a non-programmatic way
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
[Bottom][Contents][Prev]: IDT Export Flakey[Next]: Invalid ShortName Returned (File System Object)
Have your say! Join the MAKEMSI discussion list or view archive! Suggest improvements. No question too simple or too complex.
\->Troubleshooting->Bugs, Features and Issues (NON-MAKEMSI)->Common Objects Can't be Created (File System Object etc)

BUG: Common Objects Can't be Created (File System Object etc)

'----------------------------------------------------------------------------
'     MODULE NAME:   BugDetectionForCreateObject.vbs
'
'         $Author:   USER "Dennis"  $
'       $Revision:   1.2  $
'           $Date:   10 Jun 2004 17:37:00  $
'        $Logfile:   C:/DBAREIS/Projects.PVCS/Win32/MakeMsi/BugDetectionForCreateObject.VBS.pvcs  $
'
'     DESCRIPTION:   Looks for sundry Windows CreateObject issues.
'----------------------------------------------------------------------------


'--- Initialization ---------------------------------------------------------
dim ErrorCnt   : ErrorCnt = 0
dim OkCnt      : OkCnt    = 0
dim Msg        : Msg      = ""
dim PgmVersion : PgmVersion = "04.159"

'--- Check ------------------------------------------------------------------
CheckObject("WScript.Shell")
CheckObject("WScript.Network")
CheckObject("Scripting.FileSystemObject")
CheckObject("Scripting.Dictionary")
CheckObject("Shell.Application")
CheckObject("WindowsInstaller.Installer")



'--- Report -----------------------------------------------------------------
if  ErrorCnt = 0 then
    if Wscript.Arguments.Count = 1 then if ucase(Wscript.Arguments(0)) = "SILENT" then wscript.quit(0)
    Icon = vbInformation
    Msg  = "No problems located while checking the following " & OkCnt & " objects:" & Msg
else
    Icon = vbCritical
    Msg = "Found " & ErrorCnt & " error(s) while checking the following objects:" & Msg
end if
MsgBox Msg, Icon, "CreateObject() Checks - v" & PgmVersion


'--- Finish up --------------------------------------------------------------
set oFile  = Nothing
set oDir  = Nothing



'============================================================================
sub CheckObject(ObjectName)
'============================================================================
    on error resume next
    Msg = Msg & vbCRLF & vbCRLF & ObjectName & " : "
    dim Obj : set Obj = CreateObject(ObjectName)
    if  err.number = 0 then
        Msg   = Msg & "OK"
        OkCnt = OkCnt + 1
    else
        Msg      = Msg & "FAILED, rc = 0x" & hex(err.number) & " - " & err.description
        ErrorCnt = ErrorCnt + 1
    end if
    set Obj = Nothing
end sub


Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.Please email me any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Prev]: IDT Export Flakey[Next]: Invalid ShortName Returned (File System Object)


MAKEMSI© is (C)opyright Dennis Bareis 2003-2008 (All rights reserved).
Saturday May 28 2022 at 3:11pm
Visit MAKEMSI's Home Page
Microsoft awarded me an MVP (Most Valuable Professional award) in 2004, 2005, 2006, 2007, 2008 & 2009 for the Windows SDK (Windows Installer) area.