james_tubb
09-26-2007, 03:08 AM
Looking for a script that will display the computername of the viewer. I have modified a few scripts which work locally; however, they do not work once posted. These systems will simply be accessing the page to view their ip address, computername, and username(displayed in alert or confirmation type boxes). I can't get the computername function to work. At this point any scripting will help. User are not in the same location or administrators on their systems. Just users.
<script language=vbscript>
Set Shell = CreateObject("WScript.Shell")
CompName = Shell.ExpandEnvironmentStrings("%COMPUTERNAME%")
alert(CompName)
</script>
or
<script language=vbscript>
Set Shell = CreateObject("WScript.Shell")
CompName = Shell.ExpandEnvironmentStrings("%COMPUTERNAME%")
alert(CompName)
</script>
or
<!-- Start of ActiveX -->
<Script language="javascript">
var oNetwork = new ActiveXObject("WScript.Network")
var sComputerName = oNetwork.ComputerName
alert(sComputerName);
</script>
<!-- End of ActiveX -->
or
Successfully gathered other information. Any help?
<script language=vbscript>
Set Shell = CreateObject("WScript.Shell")
CompName = Shell.ExpandEnvironmentStrings("%COMPUTERNAME%")
alert(CompName)
</script>
or
<script language=vbscript>
Set Shell = CreateObject("WScript.Shell")
CompName = Shell.ExpandEnvironmentStrings("%COMPUTERNAME%")
alert(CompName)
</script>
or
<!-- Start of ActiveX -->
<Script language="javascript">
var oNetwork = new ActiveXObject("WScript.Network")
var sComputerName = oNetwork.ComputerName
alert(sComputerName);
</script>
<!-- End of ActiveX -->
or
Successfully gathered other information. Any help?