This is very useful visual basic script that helps you obtain your computer name and IP address on smooth and easy way. Actually, I`m putting this script in every Windows image that I create. How many times you ware in situation that you need those data and you have to ask employees to type ipconfig….? Now you can instruct them to start this script and give you information.
First create file, lets say ip_sysname with .vbs extension. Open it in text editor and paste text bellow:
dim NIC1, Nic, StrIPadd, HostName
Set NIC1 = GetObject(“winmgmts:”).InstancesOf(“Win32_NetworkAdapterConfiguration”)
For Each Nic in NIC1
if Nic.IPEnabled then
StrIPadd = Nic.IPAddress(i)
Set WshNetwork = WScript.CreateObject(“WScript.Network”)
MsgBox “LAN IP Address: “&StrIPadd & vbNewLine _
& “Computer Name: “&HostName,4160,”LAN IP Address and Host Name”
Save file and deploy it on PCs in your environment. Every time you need info about IP or Host name, instruct user to start script by double click and read you content.
I hope this was informative to you and thank you for using our website.