30 October 2012

SCCM Advanced Client Cache Size Reporting

This script will run a WMI query to gather the size of the advanced client cache and the amount of cache memory in use. It then makes a copy of the MIF file to be modified with the cache size and memory in use. It is then moved to the NOIDMIFS directory. A hardware inventory is then triggered which will force the server to retrieve the MIF file.

To properly execute this script, the MIF file included below needs to reside in the same directory as this script. It is a MIF template the VB script modifies to include the cache size and amount of cache being used.

NOTE: If you are needing a little remediation of MIF files, you can take a look at my other blog about the basics of MIF files.

You can download the script and MIF from the following links:



 '*******************************************************************************  
 '      Author: Mick Pletcher  
 '        Date: 29 October 2012  
 '    Modified:  
 '  
 '     Program: SMSCache  
 '     Version:  
 ' Description: This will retrieve the SMS/SCCM cache size and amount of memory  
 '                 in use to return to SMS via a MIF this script modifies.  
 '*******************************************************************************  
 Option Explicit  
 
 REM Define Constants  
 CONST TempFolder    = "c:\temp\"  
 CONST LogFolderName = "SMSCache"  

 REM Define Global Variables  
 DIM CACHESIZE    : Set CACHESIZE    = Nothing  
 DIM INUSE        : Set INUSE        = Nothing  
 DIM LogFolder    : LogFolder        = TempFolder & LogFolderName & "\"  
 DIM RelativePath : Set RelativePath = Nothing  

 REM Define the relative installation path  
 DefineRelativePath()  
 REM Create the Log Folder  
 CreateLogFolder()  
 REM Get Cache Info  
 GetCacheInfo()  
 REM Create MIF File to be copied to NOIDMIF directory  
 CreateMIF()  
 REM Generate MIF File  
 GenerateMIF()  
 REM Copy MIF to NOIDMIF directory  
 CopyMIF()  
 REM Initiate Hardware Inventory  
 InitiateHardwareInventory()  
 REM Cleanup Global Variables  
 GlobalVariableCleanup()  

 '*******************************************************************************  
 '*******************************************************************************  

 Sub DefineRelativePath()  

      REM Get File Name with full relative path  
      RelativePath = WScript.ScriptFullName  
      REM Remove file name, leaving relative path only  
      RelativePath = Left(RelativePath, InStrRev(RelativePath, "\"))  

 End Sub  

 '*******************************************************************************  

 Sub CreateLogFolder()  

      REM Define Local Objects  
      DIM FSO : Set FSO = CreateObject("Scripting.FileSystemObject")  

      If NOT FSO.FolderExists(TempFolder) then  
           FSO.CreateFolder(TempFolder)  
      End If  
      If NOT FSO.FolderExists(LogFolder) then  
           FSO.CreateFolder(LogFolder)  
      End If  

      REM Cleanup Local Variables  
      Set FSO = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub GetCacheInfo()  

      DIM objWMIService : Set objWMIService = GetObject("winmgmts:\\.\root\ccm\softmgmtagent")  
      DIM colCacheInfo  : Set colCacheInfo  = objWMIService.ExecQuery("SELECT * FROM CacheConfig")  
      DIM objCacheInfo  : Set objCacheInfo  = Nothing  

      For Each objCacheInfo In colCacheInfo  
           INUSE     = objCacheInfo.INUSE  
           CACHESIZE = objCacheInfo.Size  
      Next  

      REM Cleanup Local Memory  
      Set colCacheInfo  = Nothing  
      Set objCacheInfo  = Nothing  
      Set objWMIService = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub CreateMIF()  

      REM Define Local Objects  
      DIM FSO : Set FSO = CreateObject("Scripting.FileSystemObject")  

      If FSO.FileExists(RelativePath & "CacheInfo.mif") Then  
           If FSO.FileExists(RelativePath & "SMSCache.mif") Then  
                FSO.DeleteFile(RelativePath & "SMSCache.mif")  
           End If  
           FSO.CopyFile RelativePath & "CacheInfo.mif", RelativePath & "SMSCache.mif", True  
      End If  

      REM Cleanup Local Memory  
      Set FSO = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub GenerateMIF()  

      REM Define Local Constants  
      CONST ForReading = 1  
      CONST ForWriting = 2  

      REM Define Local Objects  
      DIM objFSO        : Set objFSO        = CreateObject("Scripting.FileSystemObject")  
      DIM objFile       : Set objFile       = objFSO.getFile(File)  
      DIM objTextStream : Set objTextStream = objFile.OpenAsTextStream(ForReading)  
      DIM strInclude    : strInclude        = objTextStream.ReadAll  

      REM Define Local Variables
      DIM File     : File     = RelativePath & "SMSCache.mif"  
      DIM strOld01 : strOld01 = "        Value = " & Chr(34) & "INUSE" & Chr(34)  
      DIM strNew01 : strNew01 = "        Value = " & Chr(34) & INUSE & Chr(34)  
      DIM strOld02 : strOld02 = "        Value = " & Chr(34) & "CACHESIZE" & Chr(34)  
      DIM strNew02 : strNew02 = "        Value = " & Chr(34) & CACHESIZE & Chr(34)  


      objTextStream.Close  
      Set objTextStream = Nothing  
      If InStr(strInclude,strOld01) > 0 Then  
           strInclude = Replace(strInclude,strOld01,strNew01)  
           Set objTextStream = objFile.OpenAsTextStream(ForWriting)  
           objTextStream.Write strInclude  
           objTextSTream.Close  
           Set objTextStream = Nothing  
      End If  
      If InStr(strInclude,strOld02) > 0 Then  
           strInclude = Replace(strInclude,strOld02,strNew02)  
           Set objTextStream = objFile.OpenAsTextStream(ForWriting)  
           objTextStream.Write strInclude  
           objTextSTream.Close  
           Set objTextStream = Nothing  
      End If  

      REM Cleanup Local Memory  
      Set File          = Nothing  
      Set objFile       = Nothing  
      Set objFSO        = Nothing  
      Set objTextStream = Nothing  
      Set strInclude    = Nothing  
      Set strNew01      = Nothing  
      Set strNew02      = Nothing  
      Set strOld01      = Nothing  
      Set strOld02      = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub CopyMIF()  

      REM Define Local Objects  
      DIM FSO      : Set FSO      = CreateObject("Scripting.FileSystemObject")  
      DIM NOIDMIFS : Set NOIDMIFS = Nothing  

      If FSO.FolderExists("C:\Program Files (x86)\") Then  
           NOIDMIFS = "C:\Windows\SysWOW64\CCM\Inventory\noidmifs\"  
      Else  
           NOIDMIFS = "C:\Windows\System32\CCM\Inventory\noidmifs\"  
      End If  
      IF FSO.FileExists(NOIDMIFS & "SMSCache.mif") Then  
           FSO.DeleteFile NOIDMIFS & "SMSCache.mif", True  
      End IF  
      FSO.CopyFile RelativePath & "SMSCache.mif", NOIDMIFS, True  
      If FSO.FileExists(RelativePath & "SMSCache.mif") Then  
           FSO.DeleteFile(RelativePath & "SMSCache.mif")  
      End If  

      REM Cleanup Local Memory  
      Set FSO      = Nothing  
      Set NOIDMIFS = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub InitiateHardwareInventory()  

      On Error Resume Next  

      REM Define Local Objects
      DIM oCPAppletMgr   : Set oCPAppletMgr   = CreateObject("CPApplet.CPAppletMgr")  
      DIM oClientAction  : Set oClientAction  = Nothing  
      DIM oClientActions : Set oClientActions = oCPAppletMgr.GetClientActions()  

      For Each oClientAction In oClientActions  
           If oClientAction.Name = "Hardware Inventory Collection Cycle" Then  
                oClientAction.PerformAction  
           End If  
      Next  

      REM Cleanup local memory
      Set oCPAppletMgr   = Nothing
      Set oClientAction  = Nothing
      Set oClientActions = Nothing

 End Sub  

 '*******************************************************************************  

 Sub GlobalVariableCleanup()  

      Set CACHESIZE    = Nothing  
      Set INUSE        = Nothing  
      Set LogFolder    = Nothing  
      Set RelativePath = Nothing  

 End Sub  


MIF File

 Start Component   
    Name = "SMS Client Info"  
    Start group  
      Name = "SMS Cache"  
      ID = 1  
      Class = "SMSCache"   
      Start Attribute   
         Name = "In Use"  
         ID = 1  
         Type = String(10)  
         Value = "INUSE"  
      End Attribute   
      Start Attribute   
         Name = "Size"  
         ID = 2  
         Type = String(10)  
         Value = "CACHESIZE"  
      End Attribute   
    End group   
  End Component   

26 October 2012

OpenLM Agent Silent Install

Installing OpenLM Agent is a relatively straight-forward process. There are no settings required for the msi installer. In order to make it a silent install, you first need to install it on your own machine. Once installed, the  first time it runs, there will be a configuration window appear. Input the server name and any other pertinent data and then click apply. Now, go to the %ProgramFiles%\OpenLM\OpenLM Agent\ and copy the OpenLM_Agent.exe.config file to your installation directory. In your installation script, copy this file to the %ProgramFiles%\OpenLM\OpenLM Agent\ directory once the app is installed. That is all that needs to be done to automate the silent install.

You can download the script from here

Here is the tasks in file I named install.cmd:
 msiexec.exe /i %~dp0\openlm_utilizer_agent_win_1713.msi /qb- /norestart  
 timeout 2  
 taskkill.exe /IM OpenLM_Agent.exe /t /f  
 timeout 2  
 copy %~dp0\OpenLM_Agent.exe.config "C:\Program Files (x86)\OpenLM\OpenLM Agent\OpenLM_Agent.exe.config" /v /y /z  
 "C:\Program Files (x86)\OpenLM\OpenLM Agent\OpenLM_Agent.exe"  

17 October 2012

Font Installation Script

This script will install all fonts residing in the same folder as this script resides. I reads all of the font file names in the directory into an array. It then binds the script to the fonts folder and copies the fonts over to it, thereby initiating an automatic install upon copying. As an error checking mechanism, it first checks to make sure the font does not already exists in the c:\windows\Fonts folder. If it does, it skips over the installation of that font.

NOTE: On line 81, I have it compare the name in the array to the hardcoded filename. If they are the same, then it skips and goes to the next one. This is so the script does not read the VB Script. I left off the extension because I encapsulate the VB Script within an IPF file so that SCCM only has to execute the EXE. By leaving off the extension, it doesn't read the install.ipf, install.vbs, install.exe, or the install.wsm files.

Here is the download.

 '*******************************************************************************  
 '   Author: Mick Pletcher  
 '    Date: 17 October 2012  
 '  Modified:  
 '  
 ' Description: This will install all fonts residing in the same folder as this  
 '                 script.  
 '                 1) Define the relative installation path  
 '                 2) Create the Log Folder  
 '                 3) Read list of Fonts into Array  
 '                 4) Install Fonts  
 '                 5) Cleanup Global Memory  
 '*******************************************************************************  
 Option Explicit  

 REM Define Constants  
 CONST TempFolder    = "c:\temp\"  
 CONST LogFolderName = "Fonts"  

 REM Define Global Variables  
 DIM Count        : Count = 1  
 DIM LogFolder    : LogFolder = TempFolder & LogFolderName & "\"  
 DIM RelativePath : Set RelativePath = Nothing  
 ReDIM arrFiles(1)  

 REM Define the relative installation path  
 DefineRelativePath()  
 REM Create the Log Folder  
 CreateLogFolder()  
 REM Read list of Fonts into Array  
 ReadFonts()  
 REM Install Fonts  
 InstallFonts()  
 REM Cleanup Global Memory  
 GlobalMemoryCleanup()  

 '*******************************************************************************  
 '*******************************************************************************  

 Sub DefineRelativePath()  

      REM Get File Name with full relative path  
      RelativePath = WScript.ScriptFullName  
      REM Remove file name, leaving relative path only  
      RelativePath = Left(RelativePath, InStrRev(RelativePath, "\"))  

 End Sub  

 '*******************************************************************************  

 Sub CreateLogFolder()  

      REM Define Local Objects  
      DIM FSO : Set FSO = CreateObject("Scripting.FileSystemObject")  

      If NOT FSO.FolderExists(TempFolder) then  
           FSO.CreateFolder(TempFolder)  
      End If  
      If NOT FSO.FolderExists(LogFolder) then  
           FSO.CreateFolder(LogFolder)  
      End If  

      REM Cleanup Local Variables  
      Set FSO = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub ReadFonts()  

      REM Define Local Objects  
      DIM FSO : Set FSO = CreateObject("Scripting.FileSystemObject")  

      REM Define Local Variables  
      DIM Folder : Set Folder = FSO.GetFolder(RelativePath)  
      DIM Files  : Set files  = Folder.Files  
      DIM File   : Set File   = Nothing  

      For each File in Files  
           If NOT Left(File.Name,Len(File.Name)-4) = "Install" then  
                arrFiles(Count) = File.Name  
                Count = Count + 1  
                ReDim Preserve arrFiles(Count)  
           End If  
      Next  
      Count = Count - 1  

      REM Cleanup Local Memory  
      Set File   = Nothing  
      Set Files  = Nothing  
      Set Folder = Nothing  
      Set FSO    = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub InstallFonts()  

      REM Define Local Constants  
      Const FONTS = &H14&  

      REM Define Local Objects  
      DIM FSO      : Set FSO = CreateObject("Scripting.FileSystemObject")  
      DIM i        : Set i = Nothing  
      DIM oShell   : SET oShell = CreateObject("Shell.Application")  
      DIM oFolder  : Set oFolder = oShell.Namespace(FONTS)  
      DIM WshShell : Set WshShell = WScript.CreateObject("Wscript.Shell")  

      For i = 1 to Count  
           If NOT FSO.FileExists("c:\windows\Fonts\" & arrFiles(i)) then  
                oFolder.CopyHere RelativePath & arrFiles(i), 16  
           End If  
      Next  

      REM Cleanup Local Variables  
      Set FSO = Nothing  
      Set i = Nothing  
      Set oFolder = Nothing  
      Set oShell = Nothing  
      Set WshShell = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub GlobalMemoryCleanup()  

      Set Count = Nothing  
      Set LogFolder = Nothing  
      Set RelativePath = Nothing  
      Erase arrFiles  

 End Sub  

10 October 2012

Adobe CS6 Error 1603

You are trying to install the Adobe CS6 distribution package you created using Adobe Application Manager, and it fails due to an error 1603. There are several different issues I encountered that can cause this.

  • The most common cause I saw was due to creating the distribution package using the 32-bit setting and trying to install it on a 64-bit OS. You are probably thinking about Microsoft Office 2010 where you can do that, but with CS6, you have to create independent packages for each architecture.
  • Another cause I encountered was the installation of Adobe Air while trying to install CS6 Design Stadfandard. When I uninstall Air, Design Standard successfully installed.
  • I also found that the prerequisites do not always install correctly with the distribution package the Application  Manager creates. For that, I downloaded the packages and prereq packages and installed them before the Design Standard installation. The packages are Visual C++ 2005 x86, Visual C++ 2010, and Visual C++ 2008.
  • Two machines I installed CS6 on were caused by the users having adobe CS5.5 applications open. CS6 was being installed in conjunction with the CS5.5 apps. Their profiles were still logged in with the apps open. If you manually run the installation, you will see the message appear below. Reboot the machine and it should fix this.

  • Another cause was due to the need to specify the installation directory in the configuration window of the Adobe Application Manager. You can specify an environmental variable like I did and it will translate it during installation.


07 October 2012

12v 4-pin Power Cable Shorts the Computer Out

If your computer is shorting out when you turn on the power button and you have narrowed the issue down to the short out occurring only when the 4-pin 12 volt power cable is connected, then most likely the issue is being caused by the CPU cooling device not being secured to the CPU. If this occurs, the motherboard will short out. To fix this, reseat the cooling device over the CPU. This may require you to also apply a new film of thermal paste for good contact.

In my case, my CPU is liquid cooled and the cooling channel had come loose. When I re-tightened the screws, the system powered right up with no issues. 

03 October 2012

Display All Logged On Users in a Domain

If you are like me, sometimes you need to find a few machines where no users are logged in. I have written this script that will scan a list of machines and tell whether a user is logged on or not. It reads a list of machine  names from a text file and then scans the list. It displays a status window while running of how far along it is in the scans. This can take sometime because it queries the WMI on each machine. If a machine is offline, then it will take a while to continue trying to connect to that machine until it goes to the next machine name in the list. The reason I have it read from a list is because I can easily export the list of computer names out of SMS/SCCM and into a simple delimited text file. The output file will display the list of machines with either a username to the right, signifying that there is a user logged on, or with no username beside the machine name.

You can download the file from here


 REM ***************************************************************************  
 REM ***     Program: UserLoggedOn.vbs  
 REM ***      Author: Mick Pletcher  
 REM ***     Created: 10 January 2010  
 REM ***      Edited: 02 October 2012  
 REM ***  
 REM *** Description: This script will read from a list of computer names and  
 REM ***              check to see if a user is logged on. It will write the   
 REM ***              status to the output text file for each system read from  
 REM ***              the input file. This was written like this so that admins  
 REM ***              can export lists of workstations from SMS/SCCM to find  
 REM ***              machines with no user logged on for troubleshooting  
 REM ***              deployments and/or find free machines to test other  
 REM ***              issues. It will display an error if there is no input  
 REM ***              file.  
 REM ***  
 REM ***************************************************************************  
 Option Explicit  

 REM Define Global Constants  
 CONST InputFileName  = "Workstations.txt"  
 CONST OutputFileName = "LoggedOn.txt"  

 REM Define Global Variables  
 DIM arrComputers    : Set arrComputers    = Nothing  
 DIM InputFile       : Set InputFile       = Nothing  
 DIM InputFileExists : Set InputFileExists = Nothing  
 DIM objIE           : Set objIE           = CreateObject("InternetExplorer.Application")  
 DIM OutputFile      : Set OutputFile      = Nothing  
 DIM RelativePath    : Set RelativePath    = Nothing  

 REM Define Relative Path  
 DefineRelativePath()  
 REM Define Input and Output Files  
 DefineIOFiles()  
 REM Create Display Window  
 CreateDisplayWindow()  
 If InputFileExists then  
      REM Read Input File  
      ReadInputFile()  
      REM Parse Computer Status  
      ParseComputerStatus()  
 Else  
      Wscript.Echo " File containing workstation list does not exist."  
 End If  
 REM Cleanup Global Memory  
 CleanupGlobalMemory()  

 '*******************************************************************************  
 '*******************************************************************************  

 Sub DefineRelativePath()  

      REM Get File Name with full relative path  
      RelativePath = WScript.ScriptFullName  
      REM Remove file name, leaving relative path only  
      RelativePath = Left(RelativePath, InStrRev(RelativePath, "\"))  

 End Sub  

 '*******************************************************************************  

 Sub DefineIOFiles()  

      REM Define Local Objects  
      DIM FSO : Set FSO = CreateObject("Scripting.FileSystemObject")  

      InputFile  = RelativePath & InputFileName  
      OutputFile = RelativePath & OutputFileName  
      If FSO.FileExists(InputFile) then  
           InputFileExists = True  
      Else  
           InputFileExists = False  
      End If  
      If FSO.FileExists(OutputFile) then  
           FSO.DeleteFile OutputFile, True  
      End If  

      REM Cleanup Memory  
      Set FSO = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub CreateDisplayWindow()  

      REM Define Local Constants  
      CONST strComputer = "."  

      REM Define Local Objects  
      DIM objWMIService : Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")  
      DIM colItems      : Set colItems      = objWMIService.ExecQuery ("Select PelsWidth,PelsHeight From Win32_DisplayConfiguration")  
      DIM objItem       : Set objItem       = Nothing  

      REM Define Local Variables  
      DIM intWidth        : intWidth            = 500  
      DIM intHeight       : intHeight           = 300  
      DIM intScreenWidth  : Set intScreenWidth  = Nothing  
      DIM intScreenHeight : Set intScreenHeight = Nothing  

      For Each objItem in colItems  
           intScreenWidth  = objItem.PelsWidth  
           intScreenHeight = objItem.PelsHeight  
      Next  
      objIE.Navigate "about:blank"  
      objIE.Document.Title = "Users Logged On"  
      objIE.Toolbar  = 0  
      objIE.StatusBar = 0  
      objIE.AddressBar = 0  
      objIE.MenuBar  = 0  
      objIE.Resizable = 0  
      objIE.Width   = 500  
      objIE.Height   = 300  
      While objIE.ReadyState <> 4  
           WScript.Sleep 100  
      Wend  
      objIE.Left = (intScreenWidth / 2) - (intWidth / 2)  
      objIE.Top = (intScreenHeight / 2) - (intHeight / 2)  
      objIE.Visible = True  

      REM Cleanup Local Variables  
      Set colItems        = Nothing  
      Set intScreenWidth  = Nothing  
      Set intScreenHeight = Nothing  
      Set intWidth        = Nothing  
      Set intHeight       = Nothing  
      Set objItem         = Nothing  
      Set objWMIService   = Nothing  

 End Sub  

 '******************************************************************************  

 Sub ReadInputFile()  

      REM Define Local Constant  
      CONST ForReading = 1  

      REM Define Local Variables  
      DIM FSO         : Set FSO         = CreateObject("Scripting.FileSystemObject")  
      DIM objTextFile : Set objTextFile = FSO.OpenTextFile(InputFile, ForReading)  
      DIM strText     : strText         = objTextFile.ReadAll  

      objTextFile.Close  
      arrComputers = Split(strText, VbCrLf)  

      REM Cleanup Local Variables  
      Set FSO         = Nothing  
      Set objTextFile = Nothing  
      Set strText     = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub ParseComputerStatus()  

      On Error Resume Next  

      REM Define Local Objects
      DIM FSO           : Set FSO           = CreateObject("Scripting.FileSystemObject")  
      DIM objFile       : Set objFile       = FSO.CreateTextFile(OutputFile, True)  
      DIM objWMIService : Set objWMIService = Nothing  

      REM Define Local Variables  
      DIM colItems    : Set colItems    = Nothing  
      DIM Count       : Count           = 0  
      DIM objItem     : Set objItem     = Nothing  
      DIM strComputer : Set strComputer = Nothing  
      DIM Total       : Set Total       = Nothing  

      objIE.Document.Body.InnerHTML = "<font color=black>"  
      objIE.Document.Body.InnerHTML = ""  
      objIE.Document.Body.InnerHTML = "Scanning Systems..." & "<BR>"  
      Count = Count + 1  
      Total = UBound(arrComputers)  
      For Each strComputer In arrComputers  
           Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")  
           Set colItems = objWMIService.ExecQuery("Select * from Win32_ComputerSystem",,48)  
           For Each objItem in colItems  
                If IsNull(objItem.UserName) then  
                     objFile.WriteLine( strComputer & ": ")  
                else  
                     objFile.WriteLine( strComputer & ": " & objItem.UserName )  
                End IF  
                If Round((Count/Total)*100, 0) <= 100 Then  
                     objIE.Document.Body.InnerHTML = "<font color=black>"  
                     objIE.Document.Body.InnerHTML = "Scanning Systems..." & "<BR>" & "<BR>" & Round((Count/Total)*100, 0) & "% complete"   
                     Count = Count + 1  
                End If  
           Next  
      Next  
      objIE.Document.Body.InnerHTML = "100% complete" & "<BR>" & "<BR>"&_  
                                              Total & Chr(32) & "systems scanned."  

      REM Cleanup Local Memory  
      Set colItems      = Nothing  
      Set Count         = Nothing  
      Set FSO           = Nothing  
      Set Total         = Nothing  
      Set objItem       = Nothing  
      Set objFile       = Nothing  
      Set objWMIService = Nothing  
      Set strComputer   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub CleanupGlobalMemory()  

      Set arrComputers    = Nothing  
      Set InputFile       = Nothing  
      Set InputFileExists = Nothing  
      Set OutputFile      = Nothing  
      Set RelativePath    = Nothing  

 End Sub  

28 September 2012

Verify SCCM Base Build

This will check for installed programs by verifying the existance of the uninstall registry key. This is located in the SCCM task sequencing just before the sysprep process. This also checks to see other settings on the machine such as if RDP is enabled. The script will submit the results to the log file that you can open up and review at the end of the script's execution before continuing with the build. This script is intended to be a primer only, as each firm will have different sets of programs to check for when generating a production build.

While utilizing this script, I have a task in the task sequencing right after this script that pauses the build until I click the OK button to continue. This is so I can go through and make sure all of the intended programs were installed before the image is created. If any were missed, then I know there is an issue with the task sequencing and I can manually install the program(s) before the image is generated. You can download the pause and verify scripts from the following links:




 '*******************************************************************************  
 '      Author: Mick Pletcher  
 '        Date: 09 March 2011  
 '    Modified:  
 '  
 '     Program: VerifyBaseBuild  
 '     Version: N/A  
 ' Description: This will check for installed programs by verifying the existance  
 '                 of the uninstall registry key. The programs will submit the results  
 '                 to the log file.  
 '                 1) Define the relative installation path  
 '                 2) Create the Log Folder  
 '                 3) Check if LocalAdming is in Administrators Group  
 '                 4) Check if RDP is enabled  
 '                 5) Check if VBScript RunAs Admin exists  
 '                 6) Microsoft .Net Framework 1.1  
 '                 7) Sun Java Runtime  
 '                 8) Apple Quicktime  
 '                 9) Bentley Prerequisite  
 '                10) CAD Standards  
 '                11) Make Directories  
 '                12) GSP Vision  
 '                13) GSP Way  
 '                14) GSP Enterprise Search  
 '                15) Advertisement Wizard  
 '                16) Microsoft Office 2007  
 '                17) Microsoft Office Communicator 2007  
 '                18) Microsoft Live Meeting  
 '                19) Seavus Project Viewer  
 '                20) Autodesk TruView 2011  
 '                21) Adobe Flash  
 '                22) Bentley View  
 '                23) Windows XP Mode  
 '                24) GSP PDF2  
 '                25) GS&P Directory File Service Shortcut  
 '                26) Equitrac  
 '                27) Check if Remote Registry is enabled  
 '                28) PDFx  
 '                29) Bentley XM Folder  
 '                30) Microsoft DaRT  
 '                31) Cleanup Global Variables  
 '*******************************************************************************  

 Option Explicit  

 REM Define Constants  
 CONST LogFile       = "VerifyBaseBuild.log"  
 CONST TempFolder    = "c:\temp\"  
 CONST LogFolderName = "VerifyBaseBuild"  

 REM Define Global Variables  
 DIM LogFolder  : LogFolder    = TempFolder & LogFolderName & "\"  
 DIM MsgBoxVar  : MsgBoxVar    = ""  
 DIM RelativePath : Set RelativePath = Nothing  
 REM Define the relative installation path  
 DefineRelativePath()  
 REM Create the Log Folder  
 CreateLogFolder()  
 REM Create Log File  
 CreateLogFile()  
 REM Check if LocalAdming is in Administrators Group  
 CheckLocalAdming()  
 REM Check RDP is enabled  
 CheckRDP()  
 REM Check if VBScript RunAs Admin exists  
 CheckVBScriptRunAs()  
 REM Check for Microsoft .Net Framework 1.1  
 MicrosoftDotNetFramework1DOT1()  
 REM Check for Sun Java Runtime  
 SunJavaRuntime()  
 REM Check for Apple Quicktime  
 AppleQuicktime()  
 REM Check for Bentley Prerequisite  
 BentleyPrerequisites()  
 REM Check for CAD Standards  
 CADStandards()  
 REM Check for Make Directories  
 MakeDirectories()  
 REM Check for GSP Vision  
 GSPVision()  
 REM Check for GSP Way  
 GSPWay()  
 REM Check for GSP Enterprise Search  
 GSPEnterpriseSearch()  
 REM Check for Advertisement Wizard  
 AdvertisementWizard()  
 REM Check for Microsoft Office 2007  
 MicrosoftOffice2007()  
 REM Check for Microsoft Office Communicator 2007  
 MicrosoftOfficeCommunicator2007()  
 REM Check for Microsoft Live Meeting  
 MicrosoftLiveMeeting()  
 REM Check for Seavus Project Viewer  
 SeavusProjectViewer()  
 REM Check for Adobe Flash  
 AdobeFlash()  
 REM Check for Bentley View  
 BentleyView()  
 REM Check for Windows XP Mode  
 WindowsXPMode()  
 REM Check for GSP PDF2  
 GSPPDF2()  
 REM Check for GS&P Directory File Service Shortcut  
 GSPDirectoryFileServiceShortcut()  
 REM Check for Equitrac  
 Equitrac()  
 REM Check if Remote Registry is enabled  
 CheckRemoteRegistry()  
 REM Pop up window displaying errors  
 'DisplayErrors()  
 REM Cleanup Global Variables  
 GlobalVariableCleanup()  

 '*******************************************************************************  
 '*******************************************************************************  

 Sub DefineRelativePath()  

      REM Get File Name with full relative path  
      RelativePath = WScript.ScriptFullName  
      REM Remove file name, leaving relative path only  
      RelativePath = Left(RelativePath, InStrRev(RelativePath, "\"))  

 End Sub  

 '*******************************************************************************  

 Sub CreateLogFolder()  

      REM Define Local Objects  
      DIM FSO : SET FSO = CreateObject("Scripting.FileSystemObject")  

      If NOT FSO.FolderExists(TempFolder) then  
           FSO.CreateFolder(TempFolder)  
      End If  
      If NOT FSO.FolderExists(LogFolder) then  
           FSO.CreateFolder(LogFolder)  
      End If  

      REM Cleanup Local Variables  
      Set FSO = Nothing  
 End Sub  

 '*******************************************************************************  

 Sub CreateLogFile()  

      REM Define Local Objects  
      DIM FSO   : SET FSO   = CreateObject("Scripting.FileSystemObject")  
      DIM FileTxt : Set FileTxt = FSO.CreateTextFile(LogFolder & LogFile, True)  

      FileTxt.Close  

      REM Cleanup Local Variables  
      Set FSO   = Nothing  
      Set FileTxt = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub CheckLocalAdming()  

      REM Define Local Constants  
      CONST strComputer = "."  
      CONST strUserName = "nash\localadming"  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  
      DIM Group   : Set Group   = GetObject("WinNT://" & strComputer & "/Administrators,group")  

      REM Define Local Variables  
      DIM aMember : Set aMember = Nothing  

      For Each aMember In Group.Members  
           If aMember.Name = strUserName Then  
                FileTxt.WriteLine("LocalAdming is present")  
           Else  
                FileTxt.WriteLine("LocalAdming is missing")  
           End If  
      Next  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set aMember = Nothing  
      Set FileTxt = Nothing  
      Set FSO     = Nothing  
      Set Group   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub CheckRDP()  

      REM Define Local Constants  
      CONST HKEY_LOCAL_MACHINE = &H80000002  
      CONST strComputer        = "."  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  
      DIM oReg    : Set oReg    = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_   
                                     strComputer & "\root\default:StdRegProv")  

      REM Define Local Variables  
      DIM dwValue      : Set dwValue  = Nothing  
      DIM StdOut       : Set StdOut   = WScript.StdOut  
      DIM strKeyPath   : strKeyPath   = "SYSTEM\CurrentControlSet\Control\Terminal Server"  
      DIM strValueName : strValueName = "fDenyTSConnections"  

      On Error Resume Next  

      oReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue  
      If dwValue = 1 Then  
           FileTxt.WriteLine("Remote Desktop is Currently Disabled")  
      ElseIf dwValue = 0 then  
           FileTxt.WriteLine("Remote Desktop is Currently Enabled")  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set dwValue      = Nothing  
      Set FileTxt      = Nothing  
      Set FSO          = Nothing  
      Set oReg         = Nothing  
      Set StdOut       = Nothing  
      Set StrKeyPath   = Nothing  
      Set StrValueName = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub CheckVBScriptRunAs()  

      REM Define Local Constants  
      CONST HKLM        = &H80000002  
      CONST strComputer = "."  

      REM Define Local Objects  
      DIM FSO         : SET FSO         = CreateObject("Scripting.FileSystemObject")  
      DIM FileTxt     : Set FileTxt     = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  
      DIM objRegistry : Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")  

      REM Define Local Variables  
      DIM dwValue      : Set dwValue  = Nothing  
      DIM strKeyPath   : strKeyPath   = "SOFTWARE\Classes\VBSFile\Shell\runas\Command"  
      DIM strValueName : strValueName = ""  

      objRegistry.GetStringValue HKLM,strKeyPath,strValueName,dwValue  
      If IsNull(dwValue) Then  
           FileTxt.WriteLine("VBScript RunAs key does NOT exist")  
      Else  
           FileTxt.WriteLine("VBScript RunAs key EXISTS")  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set dwValue      = Nothing  
      Set FileTxt      = Nothing  
      Set FSO          = Nothing  
      Set objRegistry  = Nothing  
      Set strKeyPath   = Nothing  
      Set strValueName = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub MicrosoftDotNetFramework1DOT1()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM Directory  : Directory      = "C:\Windows\Microsoft.NET\Framework\v1.1.4322"  
      DIM FolderTest : Set FolderTest = Nothing  
      DIM KeyTest    : Set KeyTest    = Nothing  
      DIM RegKey     : RegKey         = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{CB2F7EDD-9D1F-43C1-90FC-4F52EAE172A1}\"  
      DIM Program    : Program        = "Microsoft .Net Framework 1.1"  
      DIM ProgTest   : Set ProgTest   = Nothing  
      DIM Output     : Output         = Program & Chr(32) & "=" & Chr(32)  

      KeyTest = KeyExists(RegKey)  
      FolderTest = DirExists(Directory)  
      If (KeyTest = True) AND (FolderTest = True) then  
           ProgTest = True  
      Else  
           ProgTest = False  
      End If  
      FileTxt.WriteLine(Output & ProgTest)  
      If ProgTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & ProgTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set Directory  = Nothing  
      Set FileTxt    = Nothing  
      Set FolderTest = Nothing  
      Set FSO        = Nothing  
      Set KeyTest    = Nothing  
      Set oShell     = Nothing  
      Set Output     = Nothing  
      Set Program    = Nothing  
      Set ProgTest   = Nothing  
      Set RegKey     = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub SunJavaRuntime()  

      REM Define Local Objects  
      DIM FSO    : SET FSO      = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Program Files (x86)\Java\jre6\bin\java.exe"  
      DIM FileTest : Set FileTest = Nothing  
      DIM KeyTest  : Set KeyTest  = Nothing  
      DIM RegKey   : RegKey       = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{26A24AE4-039D-4CA4-87B4-2F83216024FF}\"  
      DIM Program  : Program      = "Java(TM) 6 Update 24"  
      DIM ProgTest : Set ProgTest = Nothing  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      KeyTest  = KeyExists(RegKey)  
      FileTest = FileExists(File)  
      If (KeyTest = True) AND (FileTest = True) then  
           ProgTest = True  
      Else  
           ProgTest = False  
      End If  
      FileTxt.WriteLine(Output & ProgTest)  
      If ProgTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & ProgTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTxt  = Nothing  
      Set FileTest = Nothing  
      Set FSO      = Nothing  
      Set KeyTest  = Nothing  
      Set oShell   = Nothing  
      Set Output   = Nothing  
      Set Program  = Nothing  
      Set ProgTest = Nothing  
      Set RegKey   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub AppleQuicktime()  

      REM Define Local Objects  
      DIM FSO    : SET FSO      = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Program Files (x86)\QuickTime\QuickTimePlayer.exe"  
      DIM FileTest : Set FileTest = Nothing  
      DIM KeyTest  : Set KeyTest  = Nothing  
      DIM RegKey   : RegKey       = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{57752979-A1C9-4C02-856B-FBB27AC4E02C}\"  
      DIM Program  : Program      = "Quicktime"  
      DIM ProgTest : Set ProgTest = Nothing  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      KeyTest = KeyExists(RegKey)  
      FileTest = FileExists(File)  
      If (KeyTest = True) AND (FileTest = True) then  
           ProgTest = True  
      Else  
           ProgTest = False  
      End If  
      FileTxt.WriteLine(Output & ProgTest)  
      If ProgTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & ProgTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTxt  = Nothing  
      Set FileTest = Nothing  
      Set FSO      = Nothing  
      Set KeyTest  = Nothing  
      Set oShell   = Nothing  
      Set Output   = Nothing  
      Set Program  = Nothing  
      Set ProgTest = Nothing  
      Set RegKey   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub BentleyPrerequisites()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM KeyTest1 : Set KeyTest1 = Nothing  
      DIM KeyTest2 : Set KeyTest2 = Nothing  
      DIM KeyTest3 : Set KeyTest3 = Nothing  
      DIM RegKey1  : RegKey1      = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{FB97C283-1F3C-42D4-AE01-ADC1DC12F774}\"  
      DIM Program1 : Program1     = "Microsoft Visual Basic for Applications core"  
      DIM RegKey2  : RegKey2      = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{A13D16C5-38A9-4D96-9647-59FCCAB12A85}\"  
      DIM Program2 : Program2     = "Microsoft Visual Basic for Applications localized"  
      DIM RegKey3  : RegKey3      = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{2EA870FA-585F-4187-903D-CB9FFD21E2E0}"  
      DIM Program3 : Program3     = "DHTML Editing Component for Applications"  
      DIM Program  : Program      = "Bentley Prerequisites"  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      KeyTest1 = KeyExists(RegKey1)  
      KeyTest2 = KeyExists(RegKey2)  
      KeyTest3 = KeyExists(RegKey3)  
      If KeyTest1 = True Then  
           If KeyTest2 = True Then  
                If KeyTest3 = True Then  
                     FileTxt.WriteLine(Output & KeyTest3)  
                Else  
                     FileTxt.WriteLine(Output & "False")  
                     MsgBoxVar = OutPut & "False" & Chr(13)  
                End If  
           End If  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set FileTxt  = Nothing  
      Set FSO      = Nothing  
      Set KeyTest1 = Nothing  
      Set KeyTest2 = Nothing  
      Set KeyTest3 = Nothing  
      Set oShell   = Nothing  
      Set Output   = Nothing  
      Set Program  = Nothing  
      Set Program1 = Nothing  
      Set Program2 = Nothing  
      Set Program3 = Nothing  
      Set RegKey1  = Nothing  
      Set RegKey2  = Nothing  
      Set RegKey3  = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub CADStandards()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM Directory  : Directory      = "C:\cad_stds\"  
      DIM FolderTest : Set FolderTest = Nothing  
      DIM Program    : Program        = "CAD_STDS"  
      DIM Output     : Output         = Program & Chr(32) & "=" & Chr(32)  

      FolderTest = DirExists(Directory)  
      FileTxt.WriteLine(Output & FolderTest)  
      If FolderTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & FolderTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set Directory  = Nothing  
      Set FileTxt    = Nothing  
      Set FolderTest = Nothing  
      Set FSO        = Nothing  
      Set Program    = Nothing  
      Set Output     = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub MakeDirectories()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM CADSTDSFolder : CADSTDSFolder  = "C:\cad_stds\"  
      DIM fldrGSP       : fldrGSP        = "c:\Program Files\GSP\"  
      DIM fldrDocProp   : fldrDocProp    = "c:\Program Files\GSP\DocProp\"  
      DIM fldrDGN       : fldrDGN        = "c:\DGN\"  
      DIM fldrTmp       : fldrTmp        = "c:\tmp\"  
      DIM fldrTemp      : fldrTemp       = "c:\Temp\"  
      DIM fldrBackup    : fldrBackup     = "c:\backup\"  
      DIM fldrProgGSP   : fldrProgGSP    = "c:\ProgramGSP\"  
      DIM FolderTest    : Set FolderTest = Nothing  
      DIM Output        : Output         = Chr(32) & "=" & Chr(32)  

      FolderTest = DirExists(CADSTDSFolder)  
      FileTxt.WriteLine(CADSTDSFolder & Output & FolderTest)  
      If FolderTest = False Then  
           MsgBoxVar = MsgBoxVar & CADSTDSFolder & OutPut & FolderTest & Chr(13)  
      End If  
      FolderTest = DirExists(fldrGSP)  
      FileTxt.WriteLine(fldrGSP & Output & FolderTest)  
      If FolderTest = False Then  
           MsgBoxVar = MsgBoxVar & fldrGSP & OutPut & FolderTest & Chr(13)  
      End If  
      FolderTest = DirExists(fldrDocProp)  
      FileTxt.WriteLine(fldrDocProp & Output & FolderTest)  
      If FolderTest = False Then  
           MsgBoxVar = MsgBoxVar & fldrDocProp & OutPut & FolderTest & Chr(13)  
      End If  
      FolderTest = DirExists(fldrDGN)  
      FileTxt.WriteLine(fldrDGN & Output & FolderTest)  
      If FolderTest = False Then  
           MsgBoxVar = MsgBoxVar & fldrDGN & OutPut & FolderTest & Chr(13)  
      End If  
      FolderTest = DirExists(fldrTmp)  
      FileTxt.WriteLine(fldrTmp & Output & FolderTest)  
      If FolderTest = False Then  
           MsgBoxVar = MsgBoxVar & fldrTmp & OutPut & FolderTest & Chr(13)  
      End If  
      FolderTest = DirExists(fldrTemp)  
      FileTxt.WriteLine(fldrTemp & Output & FolderTest)  
      If FolderTest = False Then  
           MsgBoxVar = MsgBoxVar & fldrTemp & OutPut & FolderTest & Chr(13)  
      End If  
      FolderTest = DirExists(fldrBackup)  
      FileTxt.WriteLine(fldrBackup & Output & FolderTest)  
      If FolderTest = False Then  
           MsgBoxVar = MsgBoxVar & fldrBackup & OutPut & FolderTest & Chr(13)  
      End If  
      FolderTest = DirExists(fldrProgGSP)  
      FileTxt.WriteLine(fldrProgGSP & Output & FolderTest)  
      If FolderTest = False Then  
           MsgBoxVar = MsgBoxVar & fldrProgGSP & OutPut & FolderTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set CADSTDSFolder = Nothing  
      Set FileTxt       = Nothing  
      Set fldrBackup    = Nothing  
      Set fldrDocProp   = Nothing  
      Set fldrDGN       = Nothing  
      Set fldrGSP       = Nothing  
      Set fldrProgGSP   = Nothing  
      Set fldrTemp      = Nothing  
      Set fldrTmp       = Nothing  
      Set FSO           = Nothing  
      Set Output        = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub GSPVision()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Users\Public\Desktop\Vision.lnk"  
      DIM FileTest : Set FileTest = Nothing  
      DIM Program  : Program      = "GS&P Vision"  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      FileTest = FileExists(File)  
      FileTxt.WriteLine(Output & FileTest)  
      If FileTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & FileTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTest = Nothing  
      Set FileTxt  = Nothing  
      Set FSO      = Nothing  
      Set Program  = Nothing  
      Set Output   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub GSPWay()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Users\Public\Desktop\GSPway.lnk"  
      DIM FileTest : Set FileTest = Nothing  
      DIM Program  : Program      = "GS&P Way"  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      FileTest = FileExists(File)  
      FileTxt.WriteLine(Output & FileTest)  
      If FileTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & FileTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTest = Nothing  
      Set FileTxt  = Nothing  
      Set FSO      = Nothing  
      Set Program  = Nothing  
      Set Output   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub GSPEnterpriseSearch()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Users\Public\Desktop\Enterprise Search.LNK"  
      DIM FileTest : Set FileTest = Nothing  
      DIM Program  : Program      = "GS&P Enterprise Search"  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      FileTest = FileExists(File)  
      FileTxt.WriteLine(Output & FileTest)  
      If FileTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & FileTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTest = Nothing  
      Set FileTxt  = Nothing  
      Set FSO      = Nothing  
      Set Program  = Nothing  
      Set Output   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub AdvertisementWizard()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Users\Public\Desktop\GSP Advertised Programs.lnk"  
      DIM FileTest : Set FileTest = Nothing  
      DIM Program  : Program      = "GS&P Advertised Programs"  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      FileTest = FileExists(File)  
      FileTxt.WriteLine(Output & FileTest)  
      If FileTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & FileTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTest = Nothing  
      Set FileTxt  = Nothing  
      Set FSO      = Nothing  
      Set Program  = Nothing  
      Set Output   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub MicrosoftOffice2007()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Program Files (x86)\Microsoft Office\Office12\OUTLOOK.EXE"  
      DIM FileTest : Set FileTest = Nothing  
      DIM KeyTest  : Set KeyTest  = Nothing  
      DIM RegKey   : RegKey       = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{90120000-0011-0000-0000-0000000FF1CE}\"  
      DIM Program  : Program      = "Office 2007"  
      DIM ProgTest : Set ProgTest = Nothing  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      KeyTest = KeyExists(RegKey)  
      FileTest = FileExists(File)  
      If (KeyTest = True) AND (FileTest = True) then  
           ProgTest = True  
      Else  
           ProgTest = False  
      End If  
      FileTxt.WriteLine(Output & ProgTest)  
      If ProgTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & ProgTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTxt  = Nothing  
      Set FileTest = Nothing  
      Set FSO      = Nothing  
      Set KeyTest  = Nothing  
      Set oShell   = Nothing  
      Set Output   = Nothing  
      Set Program  = Nothing  
      Set ProgTest = Nothing  
      Set RegKey   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub MicrosoftOfficeCommunicator2007()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Program Files (x86)\Microsoft Office Communicator\communicator.exe"  
      DIM FileTest : Set FileTest = Nothing  
      DIM KeyTest  : Set KeyTest  = Nothing  
      DIM RegKey   : RegKey       = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{0D1CBBB9-F4A8-45B6-95E7-202BA61D7AF4}\"  
      DIM Program  : Program      = "Communicator 2007"  
      DIM ProgTest : Set ProgTest = Nothing  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      KeyTest = KeyExists(RegKey)  
      FileTest = FileExists(File)  
      If (KeyTest = True) AND (FileTest = True) then  
           ProgTest = True  
      Else  
           ProgTest = False  
      End If  
      If ProgTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & ProgTest & Chr(13)  
      End If  
      FileTxt.WriteLine(Output & ProgTest)  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTxt  = Nothing  
      Set FileTest = Nothing  
      Set FSO      = Nothing  
      Set KeyTest  = Nothing  
      Set oShell   = Nothing  
      Set Output   = Nothing  
      Set Program  = Nothing  
      Set ProgTest = Nothing  
      Set RegKey   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub MicrosoftLiveMeeting()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Program Files (x86)\Microsoft Office\Live Meeting 8\Console\PWConsole.exe"  
      DIM FileTest : Set FileTest = Nothing  
      DIM KeyTest  : Set KeyTest  = Nothing  
      DIM RegKey   : RegKey       = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{AC388C78-2619-452C-BFBE-FABCC3194387}\"  
      DIM Program  : Program      = "Live Meeting"  
      DIM ProgTest : Set ProgTest = Nothing  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      KeyTest = KeyExists(RegKey)  
      FileTest = FileExists(File)  
      If (KeyTest = True) AND (FileTest = True) then  
           ProgTest = True  
      Else  
           ProgTest = False  
      End If  
      FileTxt.WriteLine(Output & ProgTest)  
      If ProgTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & ProgTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTxt  = Nothing  
      Set FileTest = Nothing  
      Set FSO      = Nothing  
      Set KeyTest  = Nothing  
      Set oShell   = Nothing  
      Set Output   = Nothing  
      Set Program  = Nothing  
      Set ProgTest = Nothing  
      Set RegKey   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub SeavusProjectViewer()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Program Files (x86)\Seavus\Seavus Project Viewer\SeavusProjectViewer.exe"  
      DIM FileTest : Set FileTest = Nothing  
      DIM KeyTest  : Set KeyTest  = Nothing  
      DIM RegKey   : RegKey       = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{EC852FE4-9F93-4152-ADB8-916623FB45AA}\"  
      DIM Program  : Program      = "Seavus Project Viewer"  
      DIM ProgTest : Set ProgTest = Nothing  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      KeyTest = KeyExists(RegKey)  
      FileTest = FileExists(File)  
      If (KeyTest = True) AND (FileTest = True) then  
           ProgTest = True  
      Else  
           ProgTest = False  
      End If  
      FileTxt.WriteLine(Output & ProgTest)  
      If ProgTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & ProgTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTxt  = Nothing  
      Set FileTest = Nothing  
      Set FSO      = Nothing  
      Set KeyTest  = Nothing  
      Set oShell   = Nothing  
      Set Output   = Nothing  
      Set Program  = Nothing  
      Set ProgTest = Nothing  
      Set RegKey   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub AdobeFlash()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM KeyTest : Set KeyTest = Nothing  
      DIM RegKey  : RegKey      = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{148D9D03-5D23-4D4F-B5D0-BA6030C45DCF}\"  
      DIM Program : Program     = "Adobe Flash"  
      DIM Output  : Output      = Program & Chr(32) & "=" & Chr(32)  

      KeyTest = KeyExists(RegKey)  
      FileTxt.WriteLine(Output & KeyTest)  
      If KeyTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & KeyTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set FileTxt = Nothing  
      Set FSO     = Nothing  
      Set KeyTest = Nothing  
      Set oShell  = Nothing  
      Set Output  = Nothing  
      Set Program = Nothing  
      Set RegKey  = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub BentleyView()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Program Files (x86)\Bentley\View V8i\View\BentleyView.exe"  
      DIM FileTest : Set FileTest = Nothing  
      DIM KeyTest  : Set KeyTest  = Nothing  
      DIM RegKey   : RegKey       = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{87D6CF41-5817-4725-8AB2-90E6B20EDE02}\"  
      DIM Program  : Program      = "Bentley View"  
      DIM ProgTest : Set ProgTest = Nothing  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      KeyTest = KeyExists(RegKey)  
      FileTest = FileExists(File)  
      If (KeyTest = True) AND (FileTest = True) then  
           ProgTest = True  
      Else  
           ProgTest = False  
      End If  
      FileTxt.WriteLine(Output & ProgTest)  
      If ProgTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & ProgTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTxt  = Nothing  
      Set FileTest = Nothing  
      Set FSO      = Nothing  
      Set KeyTest  = Nothing  
      Set oShell   = Nothing  
      Set Output   = Nothing  
      Set Program  = Nothing  
      Set ProgTest = Nothing  
      Set RegKey   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub WindowsXPMode()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Program Files\Windows XP Mode\Windows XP Mode base.vhd"  
      DIM FileTest : Set FileTest = Nothing  
      DIM KeyTest  : Set KeyTest  = Nothing  
      DIM RegKey   : RegKey       = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{1374CC63-B520-4f3f-98E8-E9020BF01CFF}\"  
      DIM Program  : Program      = "Windows XP Mode"  
      DIM ProgTest : Set ProgTest = Nothing  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      KeyTest = KeyExists(RegKey)  
      FileTest = FileExists(File)  
      If (KeyTest = True) AND (FileTest = True) then  
           ProgTest = True  
      Else  
           ProgTest = False  
      End If  
      FileTxt.WriteLine(Output & ProgTest)  
      If ProgTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & ProgTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTxt  = Nothing  
      Set FileTest = Nothing  
      Set FSO      = Nothing  
      Set KeyTest  = Nothing  
      Set oShell   = Nothing  
      Set Output   = Nothing  
      Set Program  = Nothing  
      Set ProgTest = Nothing  
      Set RegKey   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub GSPPDF2()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Program Files (x86)\GSPPDF2\pdfwriter.exe"  
      DIM FileTest : Set FileTest = Nothing  
      DIM KeyTest  : Set KeyTest  = Nothing  
      DIM RegKey   : RegKey       = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\GSP PDF Creator 2\"  
      DIM Program  : Program      = "GSPPDF2"  
      DIM ProgTest : Set ProgTest = Nothing  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      KeyTest = KeyExists(RegKey)  
      FileTest = FileExists(File)  
      If (KeyTest = True) AND (FileTest = True) then  
           ProgTest = True  
      Else  
           ProgTest = False  
      End If  
      FileTxt.WriteLine(Output & ProgTest)  
      If ProgTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & ProgTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTxt  = Nothing  
      Set FileTest = Nothing  
      Set FSO      = Nothing  
      Set KeyTest  = Nothing  
      Set oShell   = Nothing  
      Set Output   = Nothing  
      Set Program  = Nothing  
      Set ProgTest = Nothing  
      Set RegKey   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub GSPDirectoryFileServiceShortcut()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Users\Public\Desktop\GS&P Directory File Service.lnk"  
      DIM FileTest : Set FileTest = Nothing  
      DIM Program  : Program      = "GS&P Directory File Service"  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      FileTest = FileExists(File)  
      FileTxt.WriteLine(Output & FileTest)  
      If FileTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & FileTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTest = Nothing  
      Set FileTxt  = Nothing  
      Set FSO      = Nothing  
      Set Program  = Nothing  
      Set Output   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub Equitrac()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Program Files\Equitrac\Professional\Client\EQToolTray.exe"  
      DIM FileTest : Set FileTest = Nothing  
      DIM KeyTest  : Set KeyTest  = Nothing  
      DIM RegKey   : RegKey       = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{C8DED4CE-A2CF-4370-8A7E-96D941126F97}\"  
      DIM Program  : Program      = "Equitrac"  
      DIM ProgTest : Set ProgTest = Nothing  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      KeyTest = KeyExists(RegKey)  
      FileTest = FileExists(File)  
      If (KeyTest = True) AND (FileTest = True) then  
           ProgTest = True  
      Else  
           ProgTest = False  
      End If  
      FileTxt.WriteLine(Output & ProgTest)  
      If ProgTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & ProgTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTxt  = Nothing  
      Set FileTest = Nothing  
      Set FSO      = Nothing  
      Set KeyTest  = Nothing  
      Set oShell   = Nothing  
      Set Output   = Nothing  
      Set Program  = Nothing  
      Set ProgTest = Nothing  
      Set RegKey   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub CheckRemoteRegistry()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM ArrComputer   : ArrComputer       = Array(".")  
      DIM ArrServices   : ArrServices       = Array("Remote Registry")  
      DIM colItems      : Set colItems      = Nothing  
      DIM objItem       : Set objItem       = Nothing  
      DIM objWMIService : Set objWMIService = Nothing  
      DIM Service       : Set Service       = Nothing  
      DIM strComputer   : strComputer       = "."  

      For Each strComputer In ArrComputer  
           For Each Service In ArrServices  
                Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")  
                Set colItems = objWMIService.ExecQuery("Select * from Win32_Service where DisplayName = '" & Service & "'")  
                For Each objItem in colItems  
                     If objItem.State = "Running" then  
                          FileTxt.WriteLine("Remote Registry service is running")  
                     Else  
                          FileTxt.WriteLine("Remote Registry service is NOT running")  
                     End If  
                Next  
           Next  
      Next  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set ArrComputer   = Nothing  
      Set ArrServices   = Nothing  
      Set colItems      = Nothing  
      Set FileTxt       = Nothing  
      Set FSO           = Nothing  
      Set objItem       = Nothing  
      Set objWMIService = Nothing  
      Set Service       = Nothing  
      Set strComputer   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub PDFx()  

      REM Define Local Objects  
      DIM FSO     : SET FSO     = CreateObject("Scripting.FileSystemObject")  
      DIM oShell  : SET oShell  = CreateObject("Wscript.Shell")  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM File     : File         = "C:\Program Files (x86)\PDFx\PDFx.exe"  
      DIM FileTest : Set FileTest = Nothing  
      DIM KeyTest  : Set KeyTest  = Nothing  
      DIM RegKey   : RegKey       = "HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{33B72057-339D-4D08-BC19-3452C7C807EB}\"  
      DIM Program  : Program      = "PDFx2"  
      DIM ProgTest : Set ProgTest = Nothing  
      DIM Output   : Output       = Program & Chr(32) & "=" & Chr(32)  

      KeyTest = KeyExists(RegKey)  
      FileTest = FileExists(File)  
      If (KeyTest = True) AND (FileTest = True) then  
           ProgTest = True  
      Else  
           ProgTest = False  
      End If  
      FileTxt.WriteLine(Output & ProgTest)  
      If ProgTest = False Then  
           MsgBoxVar = MsgBoxVar & OutPut & ProgTest & Chr(13)  
      End If  
      FileTxt.Close  

      REM Cleanup Local Variables  
      Set File     = Nothing  
      Set FileTxt  = Nothing  
      Set FileTest = Nothing  
      Set FSO      = Nothing  
      Set KeyTest  = Nothing  
      Set oShell   = Nothing  
      Set Output   = Nothing  
      Set Program  = Nothing  
      Set ProgTest = Nothing  
      Set RegKey   = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub XMBentleyExists()  

      REM Define Local Objects  
      DIM FileTxt : Set FileTxt = FSO.OpenTextFile(LogFolder & LogFile, 8, True)  

      REM Define Local Variables  
      DIM FolderTest      : Set FolderTest  = Nothing  
      DIM XMBentleyFolder : XMBentleyFolder = "C:\Users\Default\AppData\Roaming\XMBENTLEY\"  

      FolderTest = DirExists(XMBentleyFolder)  
      If FolderTest = False Then  
           FileTxt.WriteLine(XMBentleyFolder & Chr(32) & "does not exist")  
      Else  
           FileTxt.WriteLine(XMBentleyFolder & Chr(32) & "exists")  
      End If  

      REM Cleanup Local Variables  
      Set FileTxt         = Nothing  
      Set FolderTest      = Nothing  
      Set XMBentleyFolder = Nothing  

 End Sub  

 '*******************************************************************************  

 Function KeyExists(Key)  

      REM Define Local Objects  
      DIM oShell : Set oShell = CreateObject("WScript.Shell")  

      On Error Resume Next  

      oShell.RegRead (Key)  
      If Err = 0 Then  
           KeyExists = True  
      Else  
           KeyExists = False  
      End If  

      REM Cleanup Local Variables  
      Set oShell = Nothing  

 End Function  

 '*******************************************************************************  

 Function FileExists(File)  

      REM Define Local Objects  
      DIM FSO : SET FSO = CreateObject("Scripting.FileSystemObject")  

      If FSO.FileExists(File) then  
           FileExists = True  
      Else  
           FileExists = False  
      End If  

      REM Cleanup Local Variables  
      Set FSO = Nothing  

 End Function  

 '*******************************************************************************  

 Function DirExists(Folder)  

      REM Define Local Objects  
      DIM FSO : SET FSO = CreateObject("Scripting.FileSystemObject")  

      If FSO.FolderExists(Folder) then  
           DirExists = True  
      Else  
           DirExists = False  
      End If  

      REM Cleanup Local Variables  
      Set FSO = Nothing  

 End Function  

 '*******************************************************************************  

 Sub DisplayErrors()  

      If MsgBoxVar = "" Then  
           MsgBoxVar = "No Errors"  
      End If  
      WScript.Echo MsgBoxVar  

 End Sub  

 '*******************************************************************************  

 Sub GlobalVariableCleanup()  

      Set LogFolder    = Nothing  
      Set MsgBoxVar    = Nothing  
      Set RelativePath = Nothing  

 End Sub  

BIOS Silent Flash

This script will perform an unattended flash of the BIOS.  It will only push header (.HDR) files to the system's CMOS for the BIOS upgrade. The .HDR file will need to be extracted from BIOS upgrades. New Computer models will need to be added to the GetComputerModel() procedure, and old models removed. When adding new computers, the relative path must be placed in front of the .HDR filename. This script was written for Dell systems, but can be modified for other brands.

NOTE: Instead of using this script for dell machines, I soon learned of the hidden switches and blogged them here for all of their BIOS upgrade files. This script can still be used though for flashing the BIOS. It will have to be modified if you would like to use this script for other model machines. You will need to change the GetComputerModel procedure for the different models/brand machines.

You can download this script from here.

'*******************************************************************************   
'     Program: FlashBIOS.vbs   
'      Author: Mick Pletcher   
'        Date: 04 March 2010   
'    Modified:   
' Description: Flashes the BIOS, unattended. This script will only push header   
'              (.HDR) files to the system's CMOS for BIOS upgrade. The .HDR   
'              file will need to be extracted from BIOS upgrades. New Computer   
'              models will need to be added to the GetComputerModel()   
'              procedure, and old models removed. When adding new computers,   
'              the relative path must be placed in front of the .HDR filename.   
'              This script was written for Dell systems, but can be modified   
'              for other brands.   
'              1) Define relative installation path   
'              2) Retrieve the computer model and assign .HDR file   
'              3) Flash the BIOS if Computer Model was found   
'              4) Cleanup Global Variables   
'*******************************************************************************   

Option Explicit   

REM Define Variables   
DIM BIOSVer      : Set BIOSVer      = Nothing   
DIM Flash        : Flash            = False   
DIM RelativePath : Set RelativePath = Nothing   

REM Define the relative installation path   
DefineRelativePath()   
REM Retrieve the computer model   
GetComputerModel()   
REM Flash the BIOS if Computer Model was found   
If Flash then   
  FlashBIOS()   
End If   
REM Cleanup Global Variables   
GlobalVariableCleanup()

'*******************************************************************************   
'*******************************************************************************   

Sub DefineRelativePath()   

  REM Get File Name with full relative path   
  RelativePath = WScript.ScriptFullName   
  REM Remove file name, leaving relative path only   
  RelativePath = Left(RelativePath, InStrRev(RelativePath, "\"))   

End Sub   

'*******************************************************************************   

Sub GetComputerModel()   

  REM Define Local Varaibles   
  DIM objWMI          : Set objWMI = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" _ 
                        & strComputer & "\root\cimv2")
  DIM colSettingsComp : Set colSettingsComp = objWMI.ExecQuery("Select * from Win32_ComputerSystem")   
  DIM CompModel       : Set CompModel   = Nothing   
  DIM objComputer     : Set objComputer = Nothing   
  DIM strComputer     : strComputer     = "."   
  

   For Each objComputer in colSettingsComp   
     CompModel = Trim(objComputer.Model)   
   Next   
   Select Case CompModel   
     Case "Latitude D410"   
       BIOSVer = RelativePath & "D410.hdr"   
       Flash = True   
     Case "Latitude D600"   
       BIOSVer = RelativePath & "D600.hdr"   
       Flash = True   
     Case "Latitude D610"   
       BIOSVer = RelativePath & "D610.hdr"   
       Flash = True   
     Case "Latitude D620"   
       BIOSVer = RelativePath & "D620.hdr"   
       Flash = True   
     Case "Latitude D630"   
       BIOSVer = RelativePath & "D630.hdr"   
       Flash = True   
     Case "Latitude D810"   
       BIOSVer = RelativePath & "D810.hdr"   
       Flash = True   
     Case "Latitude D820"   
       BIOSVer = RelativePath & "D820.hdr"   
       Flash = True   
     Case "Latitude D830"   
       BIOSVer = RelativePath & "D830.hdr"   
       Flash = True   
     Case "Latitude E6400"   
       BIOSVer = RelativePath & "E6400.hdr"   
       Flash = True   
     Case "Latitude E6500"   
       BIOSVer = RelativePath & "E6500.hdr"   
       Flash = True   
     Case "Optiplex GX270"   
       BIOSVer = RelativePath & "GX270.hdr"   
       Flash = True   
     Case "Optiplex GX280"   
       BIOSVer = RelativePath & "GX280.hdr"   
       Flash = True   
     Case "Optiplex 745"   
       BIOSVer = RelativePath & "O745.hdr"   
       Flash = True   
     Case "Optiplex 755"   
       BIOSVer = RelativePath & "O755.hdr"   
       Flash = True   
     Case "Precision M6300"   
       BIOSVer = RelativePath & "M6300.hdr"   
       Flash = True   
     Case "Precision M70"   
       BIOSVer = RelativePath & "M70.hdr"   
       Flash = True   
     Case "Precision M90"   
       BIOSVer = RelativePath & "M90.hdr"   
       Flash = True   
     Case "Precision WorkStation 360"   
       BIOSVer = RelativePath & "WS360.hdr"   
       Flash = True   
     Case "Precision WorkStation 370"   
       BIOSVer = RelativePath & "WS370.hdr"   
       Flash = True   
     Case "Precision WorkStation 380"   
       BIOSVer = RelativePath & "WS380.hdr"   
       Flash = True   
     Case "Precision WorkStation 390"   
       BIOSVer = RelativePath & "WS390.hdr"   
       Flash = True   
     Case "Precision WorkStation T3400"   
       BIOSVer = RelativePath & "T3400.hdr"   
       Flash = True   
   End Select   

   REM Cleanup Local Variables   
   Set colSettingsComp = Nothing   
   Set CompModel       = Nothing   
   Set objComputer     = Nothing   
   Set objWMI          = Nothing   
   Set strComputer     = Nothing   

 End Sub   

 '*******************************************************************************   

 Sub FlashBIOS()   

   REM Define Local Varaibles   
   Dim strComputerName : strComputerName = "."   
   Dim strNameSpace    : strNameSpace    = "root/Dellomci"
   Dim objClass        : Set objClass    = GetObject("WinMgmts:{impersonationLevel=impersonate}//" _   
                         & strComputerName & "/" & strNameSpace & ":" &
   Dim objInParam      : Set objInParam  = Nothing   
   Dim objInstance     : Set objInstance = Nothing   
   Dim objMethod       : Set objMethod   = Nothing   
   Dim ObjOutParam     : Set ObjOutParam = Nothing   
   Dim strClassName    : strClassName    = "Dell_Configuration"  
   Dim strMethod       : strMethod       = "FlashBios"
   Dim strPropValue    : strPropValue    = "Configuration"   
   DIM WinActive       : Set WinActive   = Nothing   
   DIM WshNetwork      : Set WshNetwork  = WScript.CreateObject("WScript.Network")   
   DIM WshShell        : Set WshShell    = Wscript.CreateObject("WScript.Shell")   

  
   'Retrieve the Dell_Configuration class   
    strClassName)   
   'Define task as FlashBios   
   Set objMethod = objClass.Methods_(strMethod)   
   'Set the In parameter of the method to the URL of BIOS header file   
   Set objInParam = objMethod.inParameters.SpawnInstance_()   
   objInParam.sUrl = BIOSVer   
   REM Execute the Method (Flash System)   
   Set ObjOutParam = objClass.ExecMethod_(strMethod, objInParam)   
   REM Cancel Windows Administrative Request Reboot window   
   Do   
     WinActive = WshShell.AppActivate("System Restart Notification")   
   Loop While NOT WinActive   
   WshShell.SendKeys("{TAB}")   
   Set WinActive = Nothing   
   Do   
     WinActive = WshShell.AppActivate("System Restart Notification")   
   Loop While NOT WinActive   
   WshShell.SendKeys("{ENTER}")   

   REM Local Variable Cleanup   
   Set objClass        = Nothing   
   Set objInParam      = Nothing   
   Set objInstance     = Nothing   
   Set objMethod       = Nothing   
   Set ObjOutParam     = Nothing   
   Set strClassName    = Nothing   
   Set strComputerName = Nothing   
   Set strMethod       = Nothing   
   Set strNameSpace    = Nothing   
   Set strPropValue    = Nothing   
   Set WinActive       = Nothing   
   Set WshNetwork      = Nothing   
   Set WshShell        = Nothing   

 End Sub   

 '*******************************************************************************   

 Sub GlobalVariableCleanup()   

   Set BIOSVer      = Nothing   
   Set Flash        = Nothing   
   Set RelativePath = Nothing   

 End Sub  

20 August 2012

How to transfer Safari bookmarks to Google Chrome on the iPad

There is no direct import/export way as of yet to transfer your bookmarks on the iPad from Safari to Chrome. The easiest way to transfer them is to do the transfer on a PC. Here are the steps:


  1. Install iCloud control panel
  2. Open the iCloud control panel from the Control Panel
  3. Check off Bookmarks 
  4. Click Options and select Internet Explorer
  5. Click Apply
  6. Open Internet Explorer and the bookmarks will automatically sync. To make sure the bookmarks have synced, click on the bookmark list and you should see the Safari bookmarks appear.
  7. If you have not signed into your Google account in Chrome on the iPad, go ahead and do so.
  8. Open up Google Chrome on the PC
  9. Go to Settings-->Bookmarks-->Import Bookmarks
  10. Select From Microsoft Internet Explorer
  11. Click Import

Report UAC Status to SMS or SCCM

This VB script will report the UAC status to SMS or SCCM. It queries the registry entry that shows if UAC is enabled/disabled and then edits the UAC.mif file with the status. It then initiates a hardware inventory to report the MIF file back to the SMS/SCCM.

You can download this script from here.
 '*******************************************************************************  
 '      Author: Mick Pletcher  
 '        Date: 20 August 2012  
 '    Modified:   
 '  
 '     Program: UACStatus.vbs
 '     Version:   
 ' Description: This will query the status of the UAC and report to SMS/SCCM  
 '                 1) Define the relative installation path  
 '                 2) Determine if x86 or x64  
 '                 3) Check UAC Status  
 '                 4) Generate MIF with UAC status  
 '                 5) Copy MIF to noidmifs  
 '                 6) Initiate SMS Hardware Inventory  
 '                 7) Cleanup Global Variables  
 '*******************************************************************************  
 Option Explicit

 REM Define Constants  
 CONST TempFolder  = "c:\temp\"  
 CONST LogFolderName = "UAC"  

 REM Define Global Variables  
 DIM Architecture : Set Architecture = Nothing  
 DIM RelativePath : Set RelativePath = Nothing  
 DIM UACStatus    : Set UACStatus    = Nothing  

 REM Define the relative installation path  
 DefineRelativePath()  
 REM Determine if x86 or x64  
 DetermineArchitecture()  
 REM Check UAC Status  
 CheckUACStatus()  
 REM Generate MIF with UAC status  
 GenerateMIF()  
 REM Copy MIF to noidmifs  
 CopyMIF()  
 REM Initiate SMS Hardware Inventory  
 InitiateSMSHardwareInventory()  
 REM Cleanup Global Variables  
 GlobalVariableCleanup()  

 '*******************************************************************************  
 '*******************************************************************************  

 Sub DefineRelativePath()  

      REM Get File Name with full relative path  
      RelativePath = WScript.ScriptFullName  
      REM Remove file name, leaving relative path only  
      RelativePath = Left(RelativePath, InStrRev(RelativePath, "\"))  

 End Sub  
 '*******************************************************************************  
 Sub DetermineArchitecture()  

      REM Define Local Objects  
      DIM WshShell : Set WshShell = CreateObject("WScript.Shell")  

      REM Define Local Variables  
      DIM OsType : OsType = WshShell.RegRead("HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")  

      If OsType = "x86" then  
           Architecture = "x86"  
      ElseIf OsType = "AMD64" then  
           Architecture = "x64"  
      End If  

 End Sub  

 '*******************************************************************************  

 Sub CheckUACStatus()  

      REM Define Local Constants  
      CONST HKEY_CURRENT_USER  = &H80000001  
      CONST HKEY_LOCAL_MACHINE = &H80000002  

      REM Define Local Variables  
      DIM strComputer  : strComputer  = "."  
      DIM StdOut       : Set StdOut   = WScript.StdOut  
      DIM oReg         : Set oReg     = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_  
                                        strComputer & "\root\default:StdRegProv")  
      DIM strKeyPath   : strKeyPath   = "SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System"  
      DIM strValueName : strValueName = "EnableLUA"  
      DIM dwValue      : Set dwValue  = Nothing  

      REM Get UAC value  
      oReg.GetDWORDValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,dwValue  
      If dwValue = 1 then  
           UACStatus = "Enabled"  
      Else  
           UACStatus = "Disabled"  
      End If  

      REM Local Variable Cleanup  
      Set dwValue      = Nothing  
      Set oReg         = Nothing  
      Set StdOut       = Nothing  
      Set strComputer  = Nothing  
      Set strKeyPath   = Nothing  
      Set strValueName = Nothing  

 End Sub  
 '*******************************************************************************  

 Sub GenerateMIF()  

      REM Define Local Constants  
      CONST ForReading = 1   
      CONST ForWriting = 2   

      REM Define Local Objects  
      DIM File          : File              = RelativePath & "UAC.mif"  
      DIM strOld        : strOld            = Chr(9) & Chr(9) & Chr(9) & "Value =" & Chr(32) & Chr(34) & Chr(34)  
      DIM strNew        : strNew            = Chr(9) & Chr(9) & Chr(9) & "Value =" & Chr(32) & UACStatus  
      DIM objFSO        : Set objFSO        = CreateObject("Scripting.FileSystemObject")   
      DIM objFile       : Set objFile       = objFSO.getFile(File)   
      DIM objTextStream : Set objTextStream = objFile.OpenAsTextStream(ForReading)   
      DIM strInclude    : strInclude        = objTextStream.ReadAll   

      objTextStream.Close  
      Set objTextStream = Nothing  
      If InStr(strInclude,strOld) > 0 Then   
           strInclude = Replace(strInclude,strOld,strNew)   
           Set objTextStream = objFile.OpenAsTextStream(ForWriting)   
           objTextStream.Write strInclude   
           objTextSTream.Close   
           Set objTextStream = Nothing   
      End If   

      REM Cleanup Local Variables  
      Set File          = Nothing  
      Set objFile       = Nothing   
      Set objFSO        = Nothing  
      Set objTextStream = Nothing  
      Set strInclude    = Nothing  
      Set strNew        = Nothing  
      Set strOld        = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub CopyMIF()  

      REM Define Local Objects  
      DIM FSO : Set FSO = CreateObject("Scripting.FileSystemObject")  

      If FSO.FileExists(RelativePath & "UAC.mif") then  
           If Architecture = "x86" then  
                FSO.CopyFile RelativePath & "UAC.mif", "C:\Windows\System32\CCM\Inventory\noidmifs\", True  
           ElseIF Architecture = "x64" then  
                FSO.CopyFile RelativePath & "UAC.mif", "C:\Windows\SysWOW64\CCM\Inventory\noidmifs\", True  
           End If  
      End If  

      REM Cleanup Local Memory  
      Set FSO = Nothing  

 End Sub  

 '*******************************************************************************  

 Sub InitiateSMSHardwareInventory()  

      On Error Resume Next  
      DIM oCPAppletMgr   : Set oCPAppletMgr   = CreateObject("CPApplet.CPAppletMgr")  
      DIM oClientAction  : Set oClientAction  = Nothing  
      DIM oClientActions : Set oClientActions = oCPAppletMgr.GetClientActions()  

      For Each oClientAction In oClientActions  
           If oClientAction.Name = "Hardware Inventory Collection Cycle" Then  
                oClientAction.PerformAction  
           End If  
      Next  

 End Sub  
 '*******************************************************************************  

 Sub GlobalVariableCleanup()  

      Set Architecture = Nothing  
      Set RelativePath = Nothing  
      Set UACStatus    = Nothing  

 End Sub  

Here is the download of the MIF file that will need to be placed in the same directory which the VB script is executed from. The two name fields can be changed to any name you desire. I used the name of the firm I work for.
 Start Component   
      Name = "GSP"       
      Start group   
           Name = "GSP"   
           ID = 1   
           Class = "UAC"   
           Start Attribute   
                Name = "Status"   
                ID = 1   
                Type = String(10)   
                Value = Enabled   
           End Attribute   
      End group   
 End Component