Solved

check whether sub key exist?

Posted on 2008-10-09
4
432 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
I met Paul Devereux (@pdevereux) today when I responded to his tweet asking “Anybody know how to automate adding files from disk to a folder in #outlook  ?”.  I replied back and told Paul that using automation, in this case scripting, to add files t…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

758 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now