Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Reading Registry Key

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Reading Registry Key
  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 >>
 Reading Registry Key - 8/16/2001 9:48:05 AM   
  djjwp

 

Posts: 2
Score: 0
Joined: 8/16/2001
From:
Status: offline
I'm trying to read a registry key:

Function getProxy()
var ws=WScript.CreateObject("WScript.Shell")
val = ws.RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ProxyServer\")
DefProxy = val
WScript.echo DefProxy
document.write (DefProxy + "<br>")
End Function

I keep getting Variable is undefined: "WScript"

Does anyone have a working solution to do this?
 
 
Post #: 1
 
 Re: Reading Registry Key - 8/17/2001 4:59:08 AM   
  Pieman

 

Posts: 10
Score: 0
Joined: 8/16/2001
From: United Kingdom
Status: offline
The syntax in line 2 of you code looks like the Jscript implementation. To read a regkey with VB script i use:
Dim sh, MyPath
Set Sh = CreateObject("WScript.Shell")
MyPath = Sh.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\path")

(in reply to djjwp)
 
 
Post #: 2
 
 Re: Reading Registry Key - 8/17/2001 10:51:32 AM   
  djjwp

 

Posts: 2
Score: 0
Joined: 8/16/2001
From:
Status: offline
Worked like a charm, thanks.

quote:

The syntax in line 2 of you code looks like the Jscript implementation. To read a regkey with VB script i use:
Dim sh, MyPath
Set Sh = CreateObject("WScript.Shell")
MyPath = Sh.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\path")






(in reply to djjwp)
 
 
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 >> Reading Registry Key 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