VBS Scripts To Change The Text For A Local Machines My Computer Icon

 

Here you will find several VBS scripts that will allow you to change the Text for the My Computer icon on your desktop.

 

The scripts will allow you to change the text from “My Computer” to the Computer Name, User Name or the Computer Name and User Name. There is also a script that will allow you to hard code the text as well as one that will prompt you for the text to change the caption to via an input dialog box.

 

Computer Name

Const MY_COMPUTER = &H11&

 

Set objNetwork = CreateObject("Wscript.Network")

strText = UCase(objNetwork.ComputerName)

 

Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.Namespace(MY_COMPUTER)

Set objFolderItem = objFolder.Self

 

objFolderItem.Name = strText

 

User Name

Const MY_COMPUTER = &H11&

 

Set objNetwork = CreateObject("Wscript.Network")

strText = UCase(objNetwork.UserName)

 

Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.Namespace(MY_COMPUTER)

Set objFolderItem = objFolder.Self

 

objFolderItem.Name = strText

 

Computer Name And User Name

Const MY_COMPUTER = &H11&

 

Set objNetwork = CreateObject("Wscript.Network")

strText = UCase(objNetwork.ComputerName) & vbCrLf & UCase(objNetwork.UserName)

 

Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.Namespace(MY_COMPUTER)

Set objFolderItem = objFolder.Self

 

objFolderItem.Name = strText

 

Hard Coded Text

Const MY_COMPUTER = &H11&

 

Set objNetwork = CreateObject("Wscript.Network")

strText = "Don Hite"

 

Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.Namespace(MY_COMPUTER)

Set objFolderItem = objFolder.Self

 

objFolderItem.Name = strText

 

Prompts For Text

Const MY_COMPUTER = &H11&

 

Set objNetwork = CreateObject("Wscript.Network")

strText = InputBox ("Enter Text For My Computer Icon")

 

Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.Namespace(MY_COMPUTER)

Set objFolderItem = objFolder.Self

 

objFolderItem.Name = strText

 

 

Published Sunday, June 29, 2008 7:22 AM by dhite
Filed under:

Comments

No Comments