Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Display Computer Name 1

Status
Not open for further replies.

mrasad

Technical User
Nov 16, 2003
53
GB
Hi,

I working on a online fault logging system that is attached to a database thingy. I have a problem, in order for a user to log a problem he/she needs to enter there computer name. Suggesting they "right click on my computer, properties, network id" to find computer name is not really an option.

Is there any way in which enables a user to click on a button for there computer name to be displayed? maybe some java script or somethink?

Thanks
 
I think U have to pay to use that site ....
 
That link does not help ... I've never used vb
 
Is this for some internal web site for a company? I'm just wondering why you need their computer name. If so, I'd recommend physically labeling the computers with their name so the user would then just need to look on the computer to get it.

You could also have them go to a dos prompt and type "echo %computername%".

Kevin
A+, Network+, MCP
 
I think you can only do that in server side.

example, using Server Side Includes
var ip = '<!--#echo var=&quot;REMOTE_ADDR&quot;-->';

If a user is submitting problem to the server not via email, then, server should be able to determine user's IP, from the IP you can then find out its computer name.
 
Yes, its an internal web site for a company. Although its not vital that they log there computer name, it would be helpful info to have for admin use.

Asking them to type in dos prompt is asking abit to much from them ;)

I'll try that server side thing, i've set it up so we can display there ip address, so it should not be too difficult to display computer name :)

Thanks guys .... any more suggestions would be great :)
 
I dunno whether you have fixed this yet, but you could do the dos thing with a batch file.

Have the batch file as a download from the page and ask people to download and run it.

The batch file can be as simple as
Code:
echo %COMPUTERNAME%

or to avoid any dos contact atall (apart from the cmd window opening and closeing in the background), try this one

Code:
net send %COMPUTERNAME% Your computer name is %COMPUTERNAME%

Then the computer name will pop up like a javascript alert.


Hope this helps,


JEz
 
You could also place a cookie on each machine that contains the name of the particular computer. Of course, you'll need to use something other than HTML to read it.

There's always a better way. The fun is trying to find it!
 
I'm going to ask a very stupid question. I'm young, so i've not used batch files much before. I can create a batch file in notpad right .bat?

sorry :(
 
Yes. You can use any &quot;plain text&quot; editor to write batch (.bat) files.

There's always a better way. The fun is trying to find it!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top