Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Checking Registry Entry

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,31095
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Checking Registry Entry
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Checking Registry Entry - 2/15/2006 1:08:44 AM   
  bigfatgreedykat

 

Posts: 34
Score: 0
Joined: 2/2/2006
Status: offline
Hello all

Created a script that confirms the Organisation name. This is normally viewed in My Computer - Right click properties. Unfortunately, my script does not show value held in registry.
Option Explicit

rem On Error Resume Next
Dim strKeyPath
Dim strComputer
Dim strEntryName
Dim strValue
Dim strData
Dim objReg
Dim subKey
Dim arrSubKeys
Const HKLM = &H80000000 'HKEY_LOCAL_MACHINE
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
strValue = "RegisteredOrganisation"
strComputer = "."
'Connection to registry
Set ObjReg = GetObject("winmgmts:\\" &_
strComputer & "\root\default:StdRegProv")
objReg.GetStringValue HKLM, strKeyPath, strValue, strData
If Err.Number = 0 Then
WScript.Echo ("What " & strData)
Else
WScript.Echo ("Nothing Exist " & Now)
End if
rem WScript.Echo "Your Organisation Name " & strValue

Any ideas???

 
 
Post #: 1
 
 RE: Checking Registry Entry - 2/15/2006 2:47:05 AM   
  ebgreen


Posts: 5069
Score: 31
Joined: 7/12/2005
Status: online
Does this work for you (note that I had to change RegisteredOrganisation to RegisteredOrganization that may be a locale thing and you may need to change it back):


      

_____________________________

"... 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

(in reply to bigfatgreedykat)
 
 
Post #: 2
 
 RE: Checking Registry Entry - 2/15/2006 3:38:29 AM   
  bigfatgreedykat

 

Posts: 34
Score: 0
Joined: 2/2/2006
Status: offline
Thanks

This works great.

BFGK

(in reply to ebgreen)
 
 
Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Checking Registry Entry Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts