Can someone tell me what this VBScript does?

Status
Not open for further replies.
Associate
Joined
14 Jan 2004
Posts
841
Location
Reading, UK
Hi all,

Looking at a VBScript here - not mine - which purportedly checks if an application has been installed based on the presence of a reg key, but I can't get my head around how it works (if at all)?

On Error Resume Next
Set oShell = CreateObject("Wscript.Shell")

iRetVal = oShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\(35142) - G.H.O.S.T. Installer\DisplayName")

If iRetVal = "hibu (35142) - G.H.O.S.T. Installer (Run)" Then
oShell.Run "cscript ""C:\Program Files\Installers\G.H.O.S.T.\Install.vbs""", 0, True
Else
oShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\(35142) - G.H.O.S.T. Installer\",""
oShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\(35142) - G.H.O.S.T. Installer\DisplayName", "(35142) - G.H.O.S.T. Installer"
oShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\(35142) - G.H.O.S.T. Installer\DisplayVersion", "1.0"
oShell.RegWrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\(35142) - G.H.O.S.T. Installer\UninstallString", "(35142) - G.H.O.S.T. Installer"
End If

Any thoughts?
 
Status
Not open for further replies.
Back
Top Bottom