?
Solved

Using Javascript to grab the user's computer name

Posted on 2005-04-07
6
Medium Priority
?
1,144 Views
Last Modified: 2012-06-21
Hello all,

I'm trying to write a piece of javascript to get the client's computer name.
This is what I have so far...

<html>
<head>
<title>Javascript test</title>
<script language="JavaScript" type="text/javascript">
var strComputerName
{
var WshNetwork = new ActiveXObject("WScript.Network");
strComputerName = WshNetwork.ComputerName;
}

alert(strComputerName)

</script>
</head>

<body>

This should run the script

</body>
</html>

But I'm getting the follwoing error message: "Automation server can't create object."

Does anyone know what's up with that?
Thanks,
Maurice
0
Comment
Question by:GRCHELPDESK
  • 3
  • 3
6 Comments
 
LVL 10

Accepted Solution

by:
ThaSmartUno earned 2000 total points
ID: 13730575
0
 
LVL 2

Author Comment

by:GRCHELPDESK
ID: 13730687
Hello ThaSmartUno,

Thanks for the response... even if it's a little depressing.  :)
I found the code here, and it seems to be working for them.
Unless I'm mis-understanding something...

http://www.experts-exchange.com/Web/Q_21306539.html?query=javascript+%22computer+name%22&clearTAFilter=true
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13730727
It works only on your own pc, if you run that from your browser located on your computer ...

on that Q they say "stand alone app" which im assuming means that it creates this web page on that computer and runs it.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:GRCHELPDESK
ID: 13730819
So you're saying if I went to the server that's hosting this page, and ran it from there it would work?
Well... that's hardly ideal.

In your opinion, what's the way to accomplish this?  (assuming the exchange server isn't setup for reverse dns lookup)

Thanks!
0
 
LVL 10

Expert Comment

by:ThaSmartUno
ID: 13730867
Personally I have no idea what you could use.  I have had no reason to need to know a computer name so I can't really help you with that.  Sorry (I can search in little bit, but I'm just leaving work now so I won't be able to respond for about 30-40 min)
0
 
LVL 2

Author Comment

by:GRCHELPDESK
ID: 13730923
Thanks, I appreciate the effort.  If it can't be done, I'll have to figure something else out.  I guess I'll leave the question open for a bit in case someone has a work-around.

Thanks again!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question