Login | |
|
 |
RE: check registry value if empty - 1/11/2006 2:31:07 AM
|
|
 |
|
| |
Country73
Posts: 733
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
|
Something like this: Set oShell = CreateObject("Wscript.Shell") On Error Resume Next strKey = "Path you are searching for" strKeyValue = oShell.RegRead(strKey) If Err.number <> 0 Then On Error Goto 0 wscript.echo "Not Found" Else wscript.echo strKeyValue End If
|
|
| |
|
|
|
 |
RE: check registry value if empty - 1/11/2006 7:26:34 AM
|
|
 |
|
| |
ebgreen
Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
|
Set oShell = CreateObject("Wscript.Shell") On Error Resume Next strKey = "Path you are searching for" strKeyValue = oShell.RegRead(strKey) If Err.number <> 0 Or strKeyValue = "" Then 'DO WHATEVER YOU WANT TO DO FOR AN EMPTY VALUE HERE End If
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
 |
RE: check registry value if empty - 1/11/2006 8:29:20 AM
|
|
 |
|
| |
Country73
Posts: 733
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
|
Did I just miss something here?
|
|
| |
|
|
|
 |
RE: check registry value if empty - 1/11/2006 8:30:51 AM
|
|
 |
|
| |
ebgreen
Posts: 5069
Score: 31
Joined: 7/12/2005
Status: offline
|
What you provided would have accounted for the value not being present at all. All I added was to handle if the value was present but had a value of "".
_____________________________
"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm http://www.visualbasicscript.com/m_47117/tm.htm
|
|
| |
|
|
|
|
|