Change the "My Computer" name on the desktop to %computername%.
When you log on to different systems all day with RDP (RDS), you kind of lose track on what system you are currently working.
I was looking for Windows 2008 R2 to solve this by changing the "my computer" iconname to the hostname.
I ended up with basically 3 lines of code from different scripts on several forums and a executable.
So to thank you all for sharing your wisdom on the net!
Just cut and past everything within the border to a textfile named: W2k_Set_Hostname_On_Desktop.bat
REM download setACL from: http://sourceforge.net/projects/setacl/files/
REM parameters: REM SETACL : Program REM -ON : Object name. This is the path to the object SetACL should operate on (file/directory/registry key/network share/service/printer). REM -ot : Object type. What kind of object does the object name refer to: file or directory (file), registry key (reg), service (srv), printer (prn), network share (shr)? REM -actn : Action. What should SetACL do with the object specified?
REM setowner : Sets the owner. REM -ownr : sets the owner. REM s:no : Ownername a SID?
SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -ot reg -actn setowner -ownr "n:%USERNAME%;s:n"
REM ace -ace : Adds or modifies access control entries (ACEs).
SetACL.exe -on "HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -ot reg -actn ace -ace "n:Administrators;p:full"
REG ADD "HKCR\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}" /V "LocalizedString" /t REG_EXPAND_SZ /D %computername% /F
pause
|
It works on Windows 2008 R7 and Windows 7.
I put some explanation in it witch makes it hard to read online.
The main problem is that you have to change some permissions in the register in order to get the change done.
Extra note:
If you have changed it manually in the past, it will not show the hostname.
Klik on the name, remove the name and just press enter and it will show the hostname.