Showname.exe is a very small and simple application that... well, shows the name of the computer it is running on. We use this little app in our environment by placing a shortcut to it in the Program menu of all computers. When a user calls the service desk the support person can ask the user to "Go to Start, Programs and select Showname". The user can then let the support person know what their computer is called so they can be found in the Deployment console. I know... the better answer is a more formal naming convention and/or using other Altiris products to have full owner information tied to assets... but for the rest of us this little app can be a lifesaver. Many thanks to my friend John Poland for the actual coding of this little beauty.
I use this little dos batch job. It's quick and easy. I find it useful for people to use when they have to report a computer problem. They can send in the whole output file with their trouble report and I get accurate info about their computer. These are all just command line entries with a few environmental variables. I entitle it: My Computer's Network Configuration.bat The text of the file follows below: @echo off
echo The name of this computer is: %COMPUTERNAME% echo. echo The Network configuration information will be in a file on your Desktop. echo. echo The name of the file is: %COMPUTERNAME% Configuration.txt echo. echo The file will open automatically in Notepad. echo .
echo On %DATE% at %TIME% the Network Configuration of this computer was: > "c:%HOMEPATH%\Desktop\%COMPUTERNAME% Configuration.txt" ipconfig /all >> "c:%HOMEPATH%\Desktop\%COMPUTERNAME% Configuration.txt"
pause
notepad.exe "c:%HOMEPATH%\Desktop\%COMPUTERNAME% Configuration.txt" The program outputs a text file with the info from the ipconfig /all command.
Hey try my script to display the following: - Computer Name - User Name - Domain Name - IP Address Note: All you have to do is copy the following code onto a notepad and save it with a vbscript [.vbs] extension. Double click on the script to display the result. '----------------------------------------------------------------------------------------------- Set WSHNetwork = WScript.CreateObject("WScript.Network")
Set colIPResults = GetObject("WinMGMTS:root\cimv2").ExecQuery("SELECT IPAddress FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = TRUE")
For Each objNIC In colIPResults For Each strIPAddress in objNIC.IPAddress If strAddresses = "" Then strAddresses = strIPAddress Else strAddresses = strAddresses End If Next Next
If strAddresses ="0.0.0.0" Or strAddresses ="" or strAddresses = "undefined" Then WScript.Echo "Computer Name = " & WSHNetwork.ComputerName & VBCrLf _ & "User Name = " & WSHNetwork.UserName & VBCrLf _ & "Domain Name = " & WSHNetwork.UserDomain & VBCrLf _ & "IPaddress = " & "No Connection Detected" Else WScript.Echo "Computer Name = " & WSHNetwork.ComputerName & VBCrLf _ & "User Name = " & WSHNetwork.UserName & VBCrLf _ & "Domain Name = " & WSHNetwork.UserDomain & VBCrLf _ & "IP address = " & strAddresses End If '----------------------------------------------------------------------------------------------- I hope this helps. Enjoy. Thanks, Eshwar