You mean "My Computer", not My Documents in this thread, I think...Originally Posted by kev147
This script will rename the My Computer folder to "My Computer %computername%"
This is to be used in our organisation for remote administration purposes. eg we can easily ask the user for their computername, without having to talk them through running ipconfig etc.
-------------------------------------------------------------------------------------
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
'msgbox strComputer
Set objFolder = objShell.Namespace(MY_COMPUTER)
Set objFolderItem = objFolder.Self
objFolderItem.Name = "My Computer " & strComputer
'msgbox objFolderItem.Name
'Clears Environment
Set objNetwork = nothing
Set objShell = nothing
Set objFolder = nothing
Set objFolderItem = nothing
-------------------------------------------------------------------------------------
You mean "My Computer", not My Documents in this thread, I think...Originally Posted by kev147
sorry about that guys. have just edited to be correct.