Computer name & IP address script

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”)
HostName= WshNetwork.Computername
MsgBox “LAN IP Address: “&StrIPadd & vbNewLine _
& “Computer Name: “&HostName,4160,”LAN IP Address and Host Name”
wscript.quit
end if
next

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.

Dejan Dzodan

Dejan Dzodan

IT professional for more then 15 years, mostly in financial institutions but with experience in ISP and retail. Proven in networking and overall infrastructure projects. Cisco instructor.

Leave a Reply

Your email address will not be published. Required fields are marked *


8 + 3 =