JSI Tip 7672. How can I remove 'My Computer', and other CLSIDs from the desktop, and 'My Computer' from the Start menu?

Jerold Schulman

January 19, 2004

2 Min Read
ITPro Today logo in a gray background | ITPro Today

In addition to addition to Group Policy and its' corresponding registry entries, you can cause My Computer (CLSID={20D04FE0-3AEA-1069-A2D8-08002B30309D}), My Network Places (CLSID={208D2C60-3AEA-1069-A2D7-08002B30309D}), and Recycle Bin (CLSID={645FF040-5081-101B-9F08-00AA002F954E}) to be removed from the desktop by setting the {CLSID} Value Name, a REG_DWORD data type, to 1, at HKEY_CURRENT_USERSOFTWAREMicrosoftWindowsCurrentVersionpoliciesNonEnum.

If you configure the {CLSID} Value Name at HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionpoliciesNonEnum, all users of the computer will be effected.

In Windows XP and later, setting the {20D04FE0-3AEA-1069-A2D8-08002B30309D} Value Name in the HKCU hive to 1, also removes My Computer from the Start menu, and removes the check box from the Start menu customization.

Any desktop icon that is displayed using a {CLSID} can be removed by adding the {CLSID} Value Name to the NonEnum key, in either the HKCU or HKLM hive, and setting its' data value to 1. See Special Folder keys for Windows NT 4.0.

If you set a {CLSID} Value Name in the HKLM hive, a restart will be required for the settings to become effective. If you set a {CLSID} Value Name in the HKCU hive, right-clicking the desktop and pressing refresh will cause the setting to become effective, as will a logging on.

NOTE: If you set the {CLSID} data value to 0, or remove the Value Name, the icon will be displayed.

Using REG.EXE on Windows 2000, from the Windows 2000 Support Tools, or REG.EXE built into Windows XP and later operating systems, I have scripted Hide_CLSID.bat, to make configuring these registry entries easier.

The syntax for using Hide_CLSID.bat is:

Hide_CLSID On|Off U|C [/CN:ComputerName] /ID:CLSID1 [/ID:CLSID2 /ID:CLSIDn]

Where:On|OffOn hides the icon, and Off un-hides it.U|C   U configures the logged on user, C configures the computer./CN:ComputerName This optional parameter configures a remote computer.                  ComputerName is the NetBIOS name of the remote computer.                 U|C must be a C to use this parameter./ID:CLSIDx       At least one /ID: parameter is required.                 CLSIDx can be any of the following:                   C        Configure My ComputerN        Configure My Network PlacesR        Configure Recycle Bin{clsid}  Configure this {CLSID}NOTE: None of the parameters are case sensitive.

Hide_CLSID.bat contains:

@echo offsetlocalif {%3}
{} goto syntaxset OnOff=%1shiftif /i "%OnOff%" EQU "on" goto p2if /i "%OnOff%" NEQ "off" goto syntax:p2set UorC=%1shiftif /i "%UorC%" EQU "u" goto p3if /i "%UorC%" NEQ "c" goto syntax:p3set param=%1if /i "%param:~0,4%" EQU "/id:" goto p4if /i "%param:~0,4%" NEQ "/cn:" goto syntaxif /i "%UorC%" NEQ "c" goto syntaxset CN=\%param:~4%shiftset param=%1:p4if /i "%param:~0,4%" NEQ "/id:" goto syntax:ploopif {%1}
{} goto finishset param=%1shiftif /i "%param:~0,4%" NEQ "/id:" goto syntaxset CLSID=%param:~4%if "%CLSID:~0,1%" EQU "{" goto UDefif /i "%CLSID:~0,1%" EQU "c" set CLSID={20D04FE0-3AEA-1069-A2D8-08002B30309D}&goto Udefif /i "%CLSID:~0,1%" EQU "n" set CLSID={208D2C60-3AEA-1069-A2D7-08002B30309D}&goto Udefif /i "%CLSID:~0,1%" EQU "r" set CLSID={645FF040-5081-101B-9F08-00AA002F954E}&goto Udef:syntax@echo Syntax: Hide_CLSID On^|Off U^|C [/CN:ComputerName] /ID:CLSID1 [/ID:CLSID2 /ID:CLSIDn]endlocalexit /b 1:Udefset dv=00000000if /i "%OnOff%" EQU "on" set dv=00000001set key=HKCUSOFTWAREMicrosoftWindowsCurrentVersionpoliciesNonEnumif /i "%UorC%" EQU "c" set key=%CN%HKLMSOFTWAREMicrosoftWindowsCurrentVersionpoliciesNonEnumREG ADD "%key%" /v %CLSID% /t REG_DWORD /d %dv% /f>nul 2>&1if %ERRORLEVEL% EQU 1 @echo Registry error&endlocal&exit /b 1goto :ploop:finishendlocalexit /b 0



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.

You May Also Like