I have code that will find the Value or Data but NOT just a Key itself.
I have a program that only has the (Default) value in the registry, which my code will not find? I want to use it to confirm if it is installed and then remove it if it is but I need to check for this reg Key.
This is just a fragment of the full code for testing. The reg key I'm looking for is as follows
[HKEY_LOCAL_MACHINE\SOFTWARE\CaseWare International\CaseWare Connector\2005.00.000]
I tried with and without a "\" at the end of the string and when it runs it is still returning an error. I thought maybe I have it backwards so for testing I deleted the "CaseWare Connector\2005.00.000\" key from the registry and it still returns error.
any suggestions?
I have a program that only has the (Default) value in the registry, which my code will not find? I want to use it to confirm if it is installed and then remove it if it is but I need to check for this reg Key.
This is just a fragment of the full code for testing. The reg key I'm looking for is as follows
[HKEY_LOCAL_MACHINE\SOFTWARE\CaseWare International\CaseWare Connector\2005.00.000]
Code:
On Error Resume Next
Dim Cw2005,Cwc2005,Cw2006,Cwc2006,CwInstall,CwcInstall,etc...
Set WshShell=CreateObject("WScript.Shell")
scomputername = createobject("wscript.network").computername
Cwc2005 = "HKEY_LOCAL_MACHINE\SOFTWARE\CaseWare International\CaseWare Connector\2005.00.000[COLOR=red][b]\[/b][/color]"
'---Reading registry to see if CW2005 Connector is installed
err.clear
WSHShell.RegRead(Cwc2005)
If Err Then
'Already been run, exit IF
WScript.Echo "CaseWare Connector 2005 Program not found" '---For Testing Only
Else
'---Removing CwConnector2005
WScript.Echo "CaseWare Connector 2005 found, Un-install required" '---For Testing Only
WSHShell.Run exeCwcUninstall, , True
End If
Set WSHSHell = Nothing
WScript.Quit
I tried with and without a "\" at the end of the string and when it runs it is still returning an error. I thought maybe I have it backwards so for testing I deleted the "CaseWare Connector\2005.00.000\" key from the registry and it still returns error.
any suggestions?