Saturday, April 25, 2009

Automatically Deleting a Registry Key

Normally you cannot automatically delete registry keys from reg file. But there is a way...

Simply include a minus sign inside the left bracket before the main key.

For example.
If you want to delete the key HKEY_LOCAL_MACHINE \ Software \ Microsoft \ Office \ 8.0 \ Common \ Assistants, your regfile would simply look like:


REGEDIT4

[-HKEY_LOCAL_MACHINE\Software\Microsoft\Office\8.0\Common\Assistants]

This would delete that key and any below it.

Fixing no AutoRun for CDs

If your CDs have stop starting automatically, and you have checked everything else:

  1. Go to HKEY_USERS\.Default\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
  2. The value for NoDriveTypeAutoRun should be set to 95 00 00 00

Renaming the File System Profiles

In the Control Panel / System / Performance / File System, you can select either Desktop Computer, Mobile or docking system, or Network Server.
You can change these labels to something more descriptive:

  1. Start Regedit
  2. Go to HKEY_LOCAL_MACHINE / Software / Microsoft / Windows / Current Version / FS Templates
  3. You can change the text that appears under each key

Turning Off the Help on Min, Max, Close Icons

When the mouse goes over the minimize, maximize and close icons on the upper right hand side of a window, you normally get a display telling you want those are for.
To disable that display:

  1. Start Regedit
  2. Go to HKEY_CURRENT_USER \ Control Panel \ Desktop
  3. Create a String Value called MinMaxClose
  4. Give it a value of 1
  5. Reboot

Adding Open With to the Right Click in the Explorer

To add the option Open With when you right click on a file in the Explorer:

  1. Start Regedit
  2. Go to HKEY_LOCAL_MACHINE \ Software \ CLASSES \* \ shell \ openas \ command
  3. If this key isn't there then just create it
  4. Give it the value of C:\WINDOWS\rundll32.exe shell32.dll,OpenAs_RunDLL %1

Changing the Title on Windows Media Player

You can change the title bar for the Windows Media Player

  1. Start Regedit
  2. Go to HKEY_USERS \ .DEFAULT \ Software \ Policies \ Microsoft \ WindowsMediaPlayer
  3. Create a string value of TitleBar
  4. Give it a value of whatever you want to appear in the title bar

Eliminating the Right Click on the Taskbar

To eliminate the right click on the taskbar:

Start Regedit

  1. Start Regedit
  2. Go to HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Explorer
  3. Add a DWORD and give it a name of NoTrayContextMenu
  4. Give it a value of 1
  5. Reboot

Eliminating the Right Click on the Desktop

To eliminate the right click on the desktop:

  1. Start Regedit
  2. Go to HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Explorer
  3. Add a DWORD and give it a name of NoViewContextMenu
  4. Give it a value of 1
  5. Reboot

Restricting the Start Menu, Explorer and the Desktop

There are many general restrictions you can make to the Start Menu, the Explorer and to the Desktop itself.

  1. Start Regedit
  2. Go to HKEY_Current_User / Software / Microsoft / Windows / CurrentVersion / Policies
  3. There should already be at least a Explorer section there already
  4. Additional keys that can be created under Policies are WinOldApp
  5. You can then add DWORD values set to 1 in the appropriate keys
  6. To re-enable them, either delete the key or set the value to 0
  • ClearRecentDocsOnExit = Clear of Recent Documents on Exit
  • NoAddPrinter = Adding new printers
  • NoClose = Computer Shutdown
  • NoDeletePrinter = Delete Installed Printers
  • NoDesktop = Doesn't show Desktop items as well as and Desktop right-click menu
  • NoDevMgrUpdate = Windows 98/ME web Update Manager
  • NoDrives [hex] = Hides Drives in my computer
  • NoFind = Find command
  • NoInternetIcon = Internet Icon on Desktop
  • NoNetHood = Network Neighborhood
  • NoRecentDocsHistory = Recent Documents in Start Menu
  • NoRun = Run command
  • NoSaveSettings = Save Settings on exit
  • NoSetFolders = Folders in Start Menu -> Settings
  • NoSetTaskbar = Taskbar in Start Menu -> Settings
  • NoSMMyDocs = My Documents folder in Start Menu
  • NoSMMyPictures = My Pictures folder in Start Menu
  • NoWindowsUpdate = Windows web Update

Changing Office 2000's Excel Undo History

By default, Excel has only approximately 16 undo's you can perform.

To increase that number:

  1. Start Regedit
  2. Go to HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ 9.0 \ Excel \ Options
  3. Add a dword called UndoHistory
  4. Give it the value you want for the amount you want.

Control Panel Restrictions

There are many general restrictions you can make to the Control Panel

  1. Start Regedit
  2. Go to HKEY_Current_User / Software / Microsoft / Windows / CurrentVersion / Policies
  3. Create a new keys under Policies called System
  4. You can then add DWORD values set to 1 in the appropriate keys
  5. To re-enable them, either delete the key or set the value to 0
  • NoDispCPL - Disable Display Control Panel
  • NoDispBackgroundPage - Hide Background Page
  • NoDispScrSavPage - Hide Screen Saver Page
  • NoDispAppearancePage - Hide Appearance Page
  • NoDispSettingsPage - Hide Settings Page
  • NoSecCPL - Disable Password Control Panel
  • NoPwdPage - Hide Password Change Page
  • NoAdminPage - Hide Remote Administration Page
  • NoProfilePage - Hide User Profiles Page
  • NoDevMgrPage - Hide Device Manager Page
  • NoConfigPage - Hide Hardware Profiles Page
  • NoFileSysPage - Hide File System Button
  • NoVirtMemPage - Hide Virtual Memory Button

Prevent Changes to the Start Menu

To prevent any changes to the Start Menu, even a right click:

  1. Start Regedit
  2. Go to HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Explorer
  3. Add a DWORD called NoChangeStartMenu
  4. Give it a value of 1

DOS Restrictions

There are restrictions you can make to the ability to execute DOS programs

  1. Start Regedit
  2. Go to HKEY_Current_User / Software / Microsoft / Windows / CurrentVersion / Policies
  3. Create a new key under Policies called WinOldApp
  4. You can then add DWORD values set to 1 in the appropriate keys
  5. To re-enable them, either delete the key or set the value to 0
  • Disabled - Disable MS-DOS Prompt
  • NoRealMode - Disables Single-Mode MS-DOS

Networking Restrictions

There are general restrictions you can make in Networking

  1. Start Regedit
  2. Go to HKEY_Current_User / Software / Microsoft / Windows / CurrentVersion / Policies
  3. Create a new key under Policies called Network
  4. You can then add DWORD values set to 1 in the appropriate keys
  5. To re-enable them, either delete the key or set the value to 0
  • DisablePwdCaching = Password Caching
  • HideSharePwds [hex] =Shared Passwords
  • NoEntireNetwork =Entire Network
  • NoNetSetup =Network applet
  • NoNetSetupIDPage =Network Identification tab
  • NoNetSetupSecurityPage =Network Access tab
  • NoFileSharing =Network File Sharing button
  • MinPwdLen = set Minimum Password Length (integer number: 0 - 99)
  • NoPrintSharing =Network Print Sharing button
  • NoWorkgroupContents =Network Workgroup

Changing Common Icons

You can change many of the common Windows icons.

  1. Start Regedit
  2. Go to HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ explorer \ Shell Icons
  3. The default icons are numbered in the right panel from 0-40
  4. Double click on the number of the particular icon you want to change. See the chart below.
  5. Enter the name of the icon file you want to use followed by the number of the icon in that file.
    Note: The numbering starts with zero.
  6. If you use a single .ICO file, it should be followed by a 0.
  7. e.g. - filename.dll,4 - This would actually be the 5th icon since it starts with 0.
  8. Make sure you delete the hidden file C:\WINDOWS\SHELLICONCACHE

0-13 Are the Drive and Application Icons
0 - To change the Unknown Application Icon
2 - To change the Default Application Icon
3 - To change the Closed Folder Icon
4 - To change the Open Folder Icon
5 - To change the 5 1/4" Floppy Icon
6 - To change the 3 1/2" Floppy Icon
7 - To change the Removable Disk Icon
8 - To change the Hard Drive Icon
9 - To change the Network Drive Online Icon
10 - To change the Network Drive Offline Icon
11 - To change the CD Drive Icon
12 - To change the Ramdrive Icon
13 - To change the Entire Network Icon

19-27 Are the Start Menu Icons
19 - To change the Programs Icon
20 - To change the Documents Icon
21 - To change the Settings Icon
22 - To change the Find Icon
23 - To change the Help Icon
24 - To change the Run Icon
27 - To change the Shutdown Icon

Other Icons
33 - To change the DUN Folder Icon
34 - To change the Desktop Icon
35 - To change the Control Panel Icon
37 - To change the Printer Folder Icon
40 - To change the Audio CD Icon
43 - To change the Favorites Icon
44 - To change the Logoff Icon

Comparing Registries

While working with changes to your system, you might want to see what is changing in your Registry.
Since you can export it to a text file, the steps are fairly easy

  1. Start Regedit
  2. With the very top level select - My Computer, on the Toolbar select Registry / Export Registry File
  3. I usually save it to the root of the C: drive with the name before (you don't need to add an extension)
  4. Make the change to your system
  5. Go back to Regedit
  6. Press F5 to update it
  7. Export the Registry like step 2
  8. Name the file after and have it go in the same directory
  9. Open up a DOS window
  10. Go to the directory where the two exported files are
  11. Enter FC before.reg after.reg > diff.txt
  12. Then you can edit diff.txt with your favorite text editor.

Note: I do the last steps so often I have a simple batch file already set up.

Setting Excel 2000 High-Contrast Cell Selection

If you want to increase the contrast in selected cells:

  1. Start Regedit
  2. Go to HKEY_CURRENT_USER \ Software \ Microsoft \ Office \ 9.0 \ Excel \ Options
  3. Add a DWORD value call Options6
  4. Give it a value of 16
  5. Now when you select cells, they will be white on black.

Setting the Internet Explorer Home Page

If you want to set the home page used by Internet Explorer through the registry

  1. Start Regedit
  2. Go to HKey_Current_User \ Software \ Microsoft \ Internet Explorer \ Main
  3. Give the Start Page key the string value you wish set as homepage

Preparing to Move Hard Drive to Another Computer

To remove the devices from device manager when taking a HD from one computer to another,
simply:

  1. Run Regedit
  2. Go to HKEY_LOCAL_MACHINE\ and delete the Enum section
  3. This removes all of the hardware specific settings

Setting the Recycle Bin to Always Delete

You can set the recycle bin to always delete items (like holding down the shift key when dragging files to the recycle bin)

  1. Start Regedit
  2. Go to HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Explorer \ BitBucket
  3. Set the key NukeOnDelete to 1

Changing the Location Of Special Folders

You can modify the registry to change the location of special folders like:

  • My Documents
  • Favorites
  • My Pictures
  • Personal
  1. Start Regedit
  2. Go to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders
  3. Double click on any locations you want to change and alter the path
  4. Logoff or restart for the changes to go into effect

Note: TweakUI from Microsoft will allow you to make these changes from a dialog box as well

Deleting Specific Registry Value

In a previous tip, Automatically Deleting a Registry Key, it was mentioned how to remove an entire registry key.
If you want to simply remove a specific value within a key, use the syntax below:

[Registry Key]
"value"=-

For example:

REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run]
"MSConfig"=-

would delete the value MSCONFIG.