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

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_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\NonEnum.

If you configure the \{CLSID\} Value Name at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\NonEnum, 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|Off           On 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 Computer
                   N        Configure My Network Places
                   R        Configure Recycle Bin
                   \{clsid\}  Configure this \{CLSID\}

NOTE: None of the parameters are case sensitive.
Hide_CLSID.bat contains:
@echo off
setlocal
if \{%3\}

\{\} goto syntax set OnOff=%1 shift if /i "%OnOff%" EQU "on" goto p2 if /i "%OnOff%" NEQ "off" goto syntax :p2 set UorC=%1 shift if /i "%UorC%" EQU "u" goto p3 if /i "%UorC%" NEQ "c" goto syntax :p3 set param=%1 if /i "%param:~0,4%" EQU "/id:" goto p4 if /i "%param:~0,4%" NEQ "/cn:" goto syntax if /i "%UorC%" NEQ "c" goto syntax set CN=\\%param:~4%shift set param=%1 :p4 if /i "%param:~0,4%" NEQ "/id:" goto syntax :ploop if \{%1\}

\{\} goto finish set param=%1 shift if /i "%param:~0,4%" NEQ "/id:" goto syntax set CLSID=%param:~4% if "%CLSID:~0,1%" EQU "\{" goto UDef if /i "%CLSID:~0,1%" EQU "c" set CLSID=\{20D04FE0-3AEA-1069-A2D8-08002B30309D\}&goto Udef if /i "%CLSID:~0,1%" EQU "n" set CLSID=\{208D2C60-3AEA-1069-A2D7-08002B30309D\}&goto Udef if /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\] endlocal exit /b 1 :Udef set dv=00000000 if /i "%OnOff%" EQU "on" set dv=00000001 set key=HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\NonEnum if /i "%UorC%" EQU "c" set key=%CN%HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\NonEnum REG ADD "%key%" /v %CLSID% /t REG_DWORD /d %dv% /f>nul 2>&1 if %ERRORLEVEL% EQU 1 @echo Registry error&endlocal&exit /b 1 goto :ploop :finish endlocal exit /b 0



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish