Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
August 31, 2005
A. The following code renames the My Computer icon on the desktop to "My Computer ". You can run the code as a domain-level logon script or call it from another script.
option explicitdim objNetwork, objShell, strComputer, objFolder, objFolderItemConst MY_COMPUTER = &H11&Set objNetwork = CreateObject("Wscript.Network")Set objShell = CreateObject("Shell.Application")strComputer = objNetwork.ComputerNameSet objFolder = objShell.Namespace(MY_COMPUTER)Set objFolderItem = objFolder.SelfobjFolderItem.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.
You May Also Like