Does anyone know a way in vbscript to get the hostname of a pc. I know you can execute "ipconfig -all" on command line
but I want to do it it vbscript.
Also is there a way to find if the printer connected to my pc is a local or a network printer
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2"
Set colItems = objWMIService.ExecQuery("Select * from Win32_OperatingSystem",,48)
For Each objItem in colItems
Wscript.Echo "Machine Name: " & objItem.CSName
Next
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.