tazmaniandevil
Technical User
Hi
I am new to vbscript, and want my script to ask for a machine hostname, do a dsquery using this input, then display the result on screen.
From a command prompt I am using
"dsquery computer -name %hostname%" (replacing %hostname% with the machine hostname)
This returns the info I want.
My vbscript looks like this so far:
This flashes the info I want on screen for a split second. How do I output this to screen?
Thanks in advance
I am new to vbscript, and want my script to ask for a machine hostname, do a dsquery using this input, then display the result on screen.
From a command prompt I am using
"dsquery computer -name %hostname%" (replacing %hostname% with the machine hostname)
This returns the info I want.
My vbscript looks like this so far:
Code:
Dim hName, runline
hName = Inputbox("Enter Machine Host Name","Enter Name")
Set WShell = CreateObject("WScript.Shell")
runline = ("dsquery computer -name " & hName)
WShell.Run runline
Thanks in advance