Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

exceptions

0 views
Skip to first unread message

David

unread,
Apr 12, 2010, 2:50:01 PM4/12/10
to
I have a vbs script that updates a registry key. Sometimes the key does not
exist.
I would like to test the existence of the key before doing the regwrite or
trap the exception when the regwirte fails and contiune with the script. my
experience with exceptions is limited and would appreciate any guidence.

I first tried a simple "if" statement but got a "inalid root in registry"
-------
If (objWshShell.RegRead
("HKCU\Software\Microsoft\Office\9.0\Word\Options\DOC-PATH") = True) Then
Wscript.Echo "Its there"
Else
Wscript.Echo "Its not there
End If

0 new messages