Rename "This PC" to %HOSTNAME%

HSeber

New Member
Messages
22
Reaction score
6
I'm looking for a solution for Window 11 to integrate something that will dynamically rename/update the string "This PC" found in the Windows Explorer of if un-hided on the Windows Desktop, based on the actual real %HOSTNAME% .
Everything I’ve found so far hasn’t worked, like

[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}]
@="%COMPUTERNAME%"
"LocalizedString"=hex(2):43,00,6f,00,6d,00,70,00,75,00,74,00,65,00,72,00,20,00,\
4e,00,61,00,6d,00,65,00,3a,00,20,00,20,00,25,00,43,00,4f,00,4d,00,50,00,55,\
00,54,00,45,00,52,00,4e,00,41,00,4d,00,45,00,25,00,00,00
 
Do you want to rename the computer name or "This PC" in Explorer ?

For "This PC" it's this registry key :
Code:
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}]
@="Your choice"

Computer name :
Code:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ComputerName]
"ComputerName"="Your choice"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\ComputerName\ActiveComputerName]
"ComputerName"="Your choice"
 
I like to rename "This PC" not the whole computer name. But "This PC" should be automatically named based on the current computer name preferable in the .Default user hive so that it will apply to anyone who logs into this computer.
 
that's the key mentioned above for "This PC"

And for all users normally (but never tested)
Code:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}
@="Your choice"
 
„I have already applied @=%COMPUTERNAME% across different HKLM/HKU/... CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}
paths, yet it appears to have no effect on Windows 11.
 
„I have already applied @=%COMPUTERNAME% across different HKLM/HKU/... CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}
paths, yet it appears to have no effect on Windows 11.
For me it's good

Capture.PNG


Capture2.PNG

Have you restarted the PC or at least explorer.exe ?
 
Last edited:
A manually entered Name works, it gets updated immediately in the file explorer.
My goal is to include the system variable so that when the computer name changes, the name in the Explorer view updates automatically.

You can find instructions when googling for "GPO rename This PC" like this one -> https://vrpc.com/change-this-pc-using-group-policy
but i can't get it working on Windows 11.
 
With group policy, never used.
Windows 10 and 11 generally use the same settings, but not for everything, so that might be part of it.
You have 11 Pro ?
 
I would do this with a script and add it to Post-setup - After Logon.
Read the computer name, prepare the registry same like with a static name, only difference is now knows the computer name it extracted.
Potentially even restart Explorer if important to update before next reboot.

You'll never get it to stay dynamic without a script and reflect the computer name on its own.
Problem is this registry value type is REG_SZ, if it was REG_EXPAND_SZ, then it could work with %variables%.
 
Back
Top