Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

check whether sub key exist?

Posted on 2008-10-09
4
Medium Priority
?
459 Views
Last Modified: 2012-06-22
vbs code to check whether a particular registry key exist or not , any method other than as shown in mentioned link.

http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_23540698.html
0
Comment
Question by:ankur3020
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 5

Expert Comment

by:si_shamil
ID: 22679306
Try this:
Const HKEY_LOCAL_MACHINE = &H80000002
\Level
 
Set objReg = GetObject("winmgmts:\\.\root\default:StdRegProv")
 
objReg.GetDWordValue HKEY_LOCAL_MACHINE, "\Software\Microsoft\Office\11.0\Access\Security", "Level", dwValue
 
If IsNull(dwValue) Then
    Wscript.Echo "The registry key does not exist."
Else
    Wscript.Echo "The registry key exists. (" & dwValue & ")"
End If

Open in new window

0
 
LVL 5

Expert Comment

by:si_shamil
ID: 22679313
I have type, in the script
try this instead:
Const HKEY_LOCAL_MACHINE = &H80000002
 
Set objReg = GetObject("winmgmts:\\.\root\default:StdRegProv")
 
objReg.GetDWordValue HKEY_LOCAL_MACHINE, "\Software\Microsoft\Office\11.0\Access\Security", "Level", dwValue
 
If IsNull(dwValue) Then
    Wscript.Echo "The registry key does not exist."
Else
    Wscript.Echo "The registry key exists. (" & dwValue & ")"
End If

Open in new window

0
 
LVL 5

Assisted Solution

by:si_shamil
si_shamil earned 200 total points
ID: 22679352
Typo again, it is hard to type all in Windows Mobile.. :)
Const HKEY_LOCAL_MACHINE = &H80000002
 
Set objReg = GetObject("winmgmts:\\.\root\default:StdRegProv")
 
objReg.GetDWordValue HKEY_LOCAL_MACHINE, "Software\Microsoft\Office\11.0\Access\Security", "Level", dwValue
 
If IsNull(dwValue) Then
    Wscript.Echo "The registry key does not exist."
Else
    Wscript.Echo "The registry key exists. (" & dwValue & ")"
End If

Open in new window

0
 

Accepted Solution

by:
ankur3020 earned 0 total points
ID: 22679677
thanks, they are ok.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

598 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question