A way to find the (Windows) computer name via the browser

remote desktopuser-managementwindows-xp

Ideally I'd like to send a link via staff email that staff could click on to reveal their computer name. (Specifically first part of the 'Long computer name' found in the second tab of My Computer Properties.)

Is there some JavaScript/VBScript/ActiveX object on the client side, or CGI script on the server-side that can let a user know their computer name by returning a simple web page?

For good reasons the organisations stops users from downloading/running apps, so oneClick deploy and downloading batch files is out of the question with the existing infrastructure/policy setup.

Oh – it should work for the enterprise wide install of Internet Explorer 6/Windows XP that isn't likely to be updated anytime soon.

Answers

Via email

Send them a link for:

http://%computername%

This will bring up "Internet explorer cannot display the webpage" but the address bar will show the machine name.

Server Side

You want the REMOTE_HOST server variable. First enable reverse DNS on the web server. Then create a page to return the variable you want. Here it is in ASP.

<% Response.Write ServerVariables("REMOTE_HOST") %>

Best Answer

Send them a link for:

http://%computername%

This will bring up "Internet explorer cannot display the webpage" but the address bar will show the machine name.

or

They could run a bat file from their desktop:

echo %computername% >> c:\users\%username%\Desktop\computername.html
"c:\program files\internet explorer\iexplore.exe" c:\users\%username%\Desktop\computername.html