# Simple Script - Display Computer Name Systray



## bobbi

Hi All

I do not know VB programming at all...but I'm sure this is a simple request!  

I'd like a vb script to run in the user's start up that will display their computer name in the systray or at the very least a shortcut that they can double click and get that info. 

I found a couple scripts by doing a google search but everytime I run them I get errors, and as I said...I don't know anything about VB. 

Anybody have something like that?

Thanks

Oh...by the way here is the code I copied. It came with a DLL which I copied and registered into my system file. I get an error in line 1 char 15. It says "expected end of statement" or something like that. 

Dim clsIPHost As New IPAddrsHostName.clsIPAddrsHostName

Private Sub Form_Click()
Print "IP Address: " & clsIPHost.GetIPAddress
Print "Host Name: " & clsIPHost.GetIPHostName
End Sub


----------



## Squashman

How about a simple batch file.

echo $computername%

Or you could use Sysinternals BGinfo to display that info ontop of their background.
http://www.sysinternals.com/Utilities/BgInfo.html

Here is another option as well. You can display the Comptuer Name and the User name underneath the My Computer icon.
http://www.winguides.com/registry/display.php/370/


----------



## Squashman

Here is another option that we used in the past. It uses a batch file with a program called msgbox.exe. The output looks like this.


----------



## bobbi

Thanks, i guess the batch file would work. 

I didn't want to change the computer name, mostly because instructions often say "double click My Computer" and typical users would find this confusing if their shortcut was called something else. 

I did look at BGinfo, but that's a little too much info. 

I was really interested in idiot-proofing it with a display that was on all the time. We just implemented desktop assistance and need to know the computer name in order to connect. 

I was hoping to add something to the login script or, the startup that would just show up in the systray. 

But thanks for the batch file idea. That may be our only option. 

Thanks


----------



## Squashman

And yet another simple script.
http://www.computerperformance.co.uk/Logon/VBScript/VBScript_Windows_getting_started.htm


----------



## Squashman

bobbi said:


> I did look at BGinfo, but that's a little too much info.


Bginfo is completely configurable. You don't need to display all the info. You can have it display whatever you want. If you just want the computer name displayed then configure it to just display the computer name.


----------



## bobbi

Thanks, that's very helpful.


----------



## Squashman

bobbi said:


> I didn't want to change the computer name, mostly because instructions often say "double click My Computer" and typical users would find this confusing if their shortcut was called something else.


Get creative. All you would need to do is set the Registry Value to 
My Computer is %COMPUTERNAME%


----------



## nbhakeem

Try this script

Dim Shell

Dim CompName



Set Shell = WScript.CreateObject("WScript.Shell")

CompName = Shell.ExpandEnvironmentStrings("%COMPUTERNAME%")



Msgbox "Your Computer name is " & CompName


----------

