I have designed an HTA file that shows a window and displays some text and uses VBScript to query the AD directory to get the full display name of the logged in user.
Here is the VBscript i am using to query the the name
</script>
<script language="vbscript">
Sub GetUserName()
Set objSysInfo = CreateObject("ADSystemInfo")
Set objCurrentUser = GetObject("LDAP://" & objSysInfo.UserName)
Dim GetUser
GetUser = objCurrentUser.givenName & " " & objcurrentuser.lastname
Set WshNetwork = Nothing
user.innerHTML = "<font color=""black"" face=""Verdana"" size=""4"">" & "Dear " & GetUser
& ", Thank you" & "</font>"
End Sub
</script>
</head>
Everything works great, however a problem comes in when the display name being queried contains a special character such as / or #. The HTA files errors out.
How can I escape or ignore these characters and display the name without these special characters ?
Thanks all