Results 1 to 8 of 8

Thread: Displaying computer name ?

  1. #1
    Join Date
    Jun 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Displaying computer name ?

    Hi

    I've got some web pages on the Intranet at work which I'd like to 'enhance'.

    Is in possible to display the local computer name to the user on a web page ?

    i.e. the name that the local %computername% system variable would give ?

    Thanks

    Paul

  2. #2
    Join Date
    Jun 2006
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hello I am not sure I completely understand your question

  3. #3
    Join Date
    Jun 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi

    Ok, I'll try again....

    All computers have their own name, i.e. the one set under
    Control Panel | System Properties | Computer Name
    (the one that can be displayed by entering echo %computername% from a command prompt)

    I'm hoping there is a way that this can be read and displayed on a web page, basically so something very simple like "You are using computer WKSTN001" can be put on screen.

    Does that help ?

    Paul

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    All computers have their own name, i.e. the one set under
    Control Panel | System Properties | Computer Name
    (the one that can be displayed by entering echo %computername% from a command prompt)
    (opens a terminal and tries it in zsh)
    Nope

    And there we have the problem: not all computers do have a "computer name." You could probably do something with ActiveX or Java, but other than that, it's not possible without making some adjustments to the browsers on each client machine.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You might be able to base something off IP if you could set a group of relationships... Use an array where $array['someIP'] = "someComputer";
    (this is php syntax... not too different than other languages though, though, aside from the $ for identifying variables.)

    Note that I'm talking about local IP on the network... this would be harder (maybe impossible) to implement if you were doing something web based and wanted to identify the computer from within the network that was sending the information.

    Is this for an intranet or the internet?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Sep 2004
    Location
    Little Falls, Roodepoort, South Africa
    Posts
    421
    Thanks
    4
    Thanked 1 Time in 1 Post

    Default

    With I.E try
    <!-- Start of ActiveX -->
    <Script language="javascript">
    var oNetwork = new ActiveXObject("WScript.Network")
    var sComputerName = oNetwork.ComputerName
    alert(sComputerName);
    </script>
    <!-- End of ActiveX -->
    Gives a pop up alert with the computer's name
    Very Best Rgds, Simonf :cool:
    __________________________________
    My Site | E-Mail Me

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    There we go

    Note that since it's using ActiveX, it's IE/Win only, and it may pop up a warning alert if the server isn't in the "trusted" IE zone.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Jun 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks,

    I'll give it a go when I'm back at work on Monday

    (Friday off with this terrible weather we're having... )

    Much appreciated

    Paul

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •