chrisryhal
asked on
Script to check computer name
I need a quick VBScript that basically looks for a computer name. When the VBScript is ran if the computer name is "k-tsvr2" then DO NOTHING if it is anything BUT k-tsvr2 then launch a batch file.
ASKER
Because I have a HUGE VBScript and want the code in there.
One way...
Dim objNet:Set objNet=CreateObject("Wscri pt.Network ")
If objNet.ComputerName="k-tsv r2" Then Wscript.quit
Dim objNet:Set objNet=CreateObject("Wscri
If objNet.ComputerName="k-tsv
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If "%computername%" == "k-tsvr2" GOTO End
REM --- DO EVERYTHING HERE
REM --- ETC
REM --- ETC
:End