A. The following code renames the My Computer icon on the desktop to "My Computer <hostname>". You can run the code as a domain-level logon script or call it from another script.
option explicit dim objNetwork, objShell, strComputer, objFolder, objFolderItem Const MY_COMPUTER = &H11& Set objNetwork = CreateObject("Wscript.Network") Set objShell = CreateObject("Shell.Application") strComputer = objNetwork.ComputerName Set objFolder = objShell.Namespace(MY_COMPUTER) Set objFolderItem = objFolder.Self objFolderItem.Name = "My Computer " & strComputer
You can change the last line to be any text that you want to use for the My Computer icon. It doesn't need to begin with My Computer.
0 comments
Hide comments