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
Solved

check whether sub key exist?

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

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

Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

791 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