HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old June 26th, 2001, 07:38 PM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
Get Registry Key Using WSH & ASP

<i><b>Originally posted by : Sandy (sandy.perez@ogilvy.com)</b></i><br /><br />I am trying to read registry keys using the wshShell object. I can read a value with no problem, but if I try to read a key I get a "Unable to open registry key for read" error. My code is as follows:<br /><br />------------------------------------------<br />dim wshShell<br />Set wshShell = server.CreateObject("WScript.Shell")<br /><br />'READ REGISTRY VALUE - WORKS FINE<br /><br />response.write wshShell.regread("HKLMSOFTWAREMicrosoftWindows NTCurrentVersionProductName")<br /><br />'READ REGISTRY KEY - THROWS "Unable to open registry key for read" ERROR <br /><br />response.write wshShell.regread("HKLMSOFTWAREODBCODBC.INIODBC Data Sources"")<br /><br />Set wshShell = nothing <br />------------------------------------------<br /><br />If anyone could shed light on this, I would really appreciate it. Thanks!<br />

Reply With Quote
  #2  
Old June 30th, 2001, 02:12 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : steve (steve@aspfree.com)</b></i><br />hi sandy, i tried your code and got the same result. however i put in the localserver key after the odbc data sourceslocalserver and it return the proper information. I'd guess, i don't have my book in front of me but there is another method to use to read a collection of keys with in what your trying to do.<br />steve<br /><br /><br />------------<br />Sandy at 6/26/2001 5:38:41 PM<br /><br /><br />I am trying to read registry keys using the wshShell object. I can read a value with no problem, but if I try to read a key I get a "Unable to open registry key for read" error. My code is as follows:<br /><br />------------------------------------------<br />dim wshShell<br />Set wshShell = server.CreateObject("WScript.Shell")<br /><br />'READ REGISTRY VALUE - WORKS FINE<br /><br />response.write wshShell.regread("HKLMSOFTWAREMicrosoftWindows NTCurrentVersionProductName")<br /><br />'READ REGISTRY KEY - THROWS "Unable to open registry key for read" ERROR <br /><br />response.write wshShell.regread("HKLMSOFTWAREODBCODBC.INIODBC Data Sources"")<br /><br />Set wshShell = nothing <br />------------------------------------------<br /><br />If anyone could shed light on this, I would really appreciate it. Thanks!<br />

Reply With Quote
  #3  
Old July 3rd, 2001, 05:55 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Richard (richard@trinet.co.uk)</b></i><br />When you use RegRead on a key, you are trying to read the "(Default Value)" value. The error means that the default value is not set. If you set the value, you will be able to read it. WSH doesn't seem to have a method for reading all values in a key.<br /><br />------------<br />steve at 6/30/2001 12:12:42 PM<br /><br />hi sandy, i tried your code and got the same result. however i put in the localserver key after the odbc data sourceslocalserver and it return the proper information. I'd guess, i don't have my book in front of me but there is another method to use to read a collection of keys with in what your trying to do.<br />steve<br /><br /><br />------------<br />Sandy at 6/26/2001 5:38:41 PM<br /><br /><br />I am trying to read registry keys using the wshShell object. I can read a value with no problem, but if I try to read a key I get a "Unable to open registry key for read" error. My code is as follows:<br /><br />------------------------------------------<br />dim wshShell<br />Set wshShell = server.CreateObject("WScript.Shell")<br /><br />'READ REGISTRY VALUE - WORKS FINE<br /><br />response.write wshShell.regread("HKLMSOFTWAREMicrosoftWindows NTCurrentVersionProductName")<br /><br />'READ REGISTRY KEY - THROWS "Unable to open registry key for read" ERROR <br /><br />response.write wshShell.regread("HKLMSOFTWAREODBCODBC.INIODBC Data Sources"")<br /><br />Set wshShell = nothing <br />------------------------------------------<br /><br />If anyone could shed light on this, I would really appreciate it. Thanks!<br />

Reply With Quote
  #4  
Old November 4th, 2003, 03:41 PM
BobK BobK is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 1 BobK User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RegRead error on key

This is an old post, so noone may care -- but this issue just cost me several hours.

The VBScript "RegRead" method, when applied to a registry KEY (as opposed to a VALUE) does not behave as the Microsoft documentation suggests.

When you specify a KEY (evidenced by a trailing "\"), RegRead actually looks for the DEFAULT VALUE in the KEY, not the KEY itself. If the value "(default)" is not assigned, the RegRead will fail -- even though the KEY itself really does exist.

RegRead directed to a KEY will only succeed if the "(default)" value has been assigned.

Reply With Quote
  #5  
Old November 17th, 2003, 12:35 PM
bjackson500 bjackson500 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 1 bjackson500 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question How do I set the default value?

Sorry, I realize this is a basic question. But what I need to do is to read all the keys under the hotfix (NT) section in the registry, and I'm getting the "unable to open for reading" error. I need to read all of the currently installed patches, so that I can write a script to automate their installation and keep them up to date. I have about 500 unpatched nt 4.0 machines, and no SMS or other software to do it.
I inherited a mess...

Reply With Quote
  #6  
Old November 21st, 2003, 07:16 PM
RX87325 RX87325 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 1 RX87325 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to RX87325
Microsoft has released a command line tool call qfecheck.exe to report the Hotfixes installing on a system.

URL

I think you can create an log file from qfecheck that you could use as input to into our produre.

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Get Registry Key Using WSH & ASP


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT