Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

GetSettings not supported in VBS 1

Status
Not open for further replies.

jtheis

Technical User
Sep 9, 2004
41
US
I'm trying to convert a piece of existing VBA code to VBS and I've hit a snag. Here's the VBA code I'm looking at.

Code:
Sub ShowUserName()
  Dim pt As GwxPoint
  On Error GoTo ErrorHandler
  If SecSvr Is Nothing Then Exit Sub
      
  Set pt = ThisDisplay.GetPointObjectFromName("~~USER~~")
 
  If SecSvr.LoggedIn <> "" Then
    pt.Value = GetSetting("HTS", "Security", "UserName", "DEFAULT")
    
  Else
    pt.Value = " "
  End If
  Exit Sub
ErrorHandler:
  pt.Value = "Error"
End Sub

The problem is the GetSetting function is not supported in VBS. Any ideas on how to work around this? Is there another way that I can get the same information that GetSettings returns?
 
Take a look at the WshShell.RegRead method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
PH,

Excellent! It looks like that works great in my code. Thanks!

Joe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top