-
Use browser to display computername
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?
Last edited by james_tubb; 09-26-2007 at 03:18 AM.
-
-
recently tried
<script language="vbscript">
var ax = new ActiveXObject("WScript.Network");
document.write(ax.UserName+<br>);
document.write(ax.ComputerName+<br>);
</script>
and
var hostName = System.Environment.getEnvironmentVariable("COMPUTERNAME");
both pulled from various sites
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks