obj= new ActiveXObject("wscript.network"); Note: You need to enable security settings for it. In Javascript application I need client computer name on which it is running. /* Get hostname of os in Node.js */ // import os module const os = require("os"); // get host name const hostName = os.hostname(); The method returns the name of the system where the OS currently is installed as a string. Edit: in case you can't change the printing code, reverting to a separate script called through AJAX, as Andrew suggested, may be a way of getting what you want. Is there a way to get the user computer name using javascript? Copyright 2022 Adobe. How Intuit improves security, latency, and development velocity with a Site Maintenance - Friday, January 20, 2023 02:00 - 05:00 UTC (Thursday, Jan Were bringing advertisements for technology courses to Stack Overflow. Thanks heaps for your help! So write a WebMethod which will retrieve the IP Address from the Request object and return it to caller. These contents tell us which interfaces can be invoked, the parameters of interface invocation and the way to use them. While using W3Schools, you agree to have read and accepted our. Edit: note, if you can it would be better (less HTTP requests) and easier to just include the host name in a dynamically generated