S
SLE
Hi there,
On the ASPX form, the user should enter his/her computername. I want this
TextBox to have a default value, determined from the local environment
variable %ComputerName%.
So I wrote the following VBScript function and put in in the <HEAD> section
and added <body onload="GetClientParameters">:
<script language="VBScript">
Sub GetClientParameters
Dim strName, wshShell
Set wshShell = CreateObject("WScript.Shell")
strName = WshShell.ExpandEnvironmentStrings("%ComputerName%")
document.InputForm.txtName.value = strName
End Sub
</script>
The above script works fine when launched as a VBS file, but returns an
error from IE: "ActiveX can't create object". I assume IE does not want to
execute the VBScript code for security reasons - is there another way?
Thanks,
On the ASPX form, the user should enter his/her computername. I want this
TextBox to have a default value, determined from the local environment
variable %ComputerName%.
So I wrote the following VBScript function and put in in the <HEAD> section
and added <body onload="GetClientParameters">:
<script language="VBScript">
Sub GetClientParameters
Dim strName, wshShell
Set wshShell = CreateObject("WScript.Shell")
strName = WshShell.ExpandEnvironmentStrings("%ComputerName%")
document.InputForm.txtName.value = strName
End Sub
</script>
The above script works fine when launched as a VBS file, but returns an
error from IE: "ActiveX can't create object". I assume IE does not want to
execute the VBScript code for security reasons - is there another way?
Thanks,