Solved

check whether sub key exist?

Posted on 2008-10-09
4
435 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
  • 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 50 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

810 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