Removing or Renaming Directory C:\Program Breaks Applications Installed Under "C:\Program Files"

ID: Q195052


The information in this article applies to:


SYMPTOMS

You create a folder called "Program" in the root of the volume hosting the Windows NT installation (boot partition). When you delete or rename it later, a dialog box comes up:

This change may impact one or more registered programs. Do you want to
continue?
This message appears even though no applications are installed in this folder.

If you click Yes, applications installed under the folder "Program Files" may not be usable anymore because the registry location will point to the Recycle Bin instead of the correct location. The application will not load for registered extensions and it cannot be started as an OLE or COM server anymore. You can still start the application through a shortcut to the executable or by double-clicking it in Explorer. The problem will happen with any path where the folder name matches the directory containing an application, for example on the German version of Windows NT, the folder "C:\Programme\Windows" can cause this problem in conjunction with the folder "C:\Programme\Windows NT".


CAUSE

On all Rename and Delete operations, the shell checks the files involved against the registry of all installed applications. If the path to the application executables contains spaces, the entry should be placed into the registry with double quotation marks around it because these entries can also contain command-line parameters.

However, many applications do not use quotation marks when adding the registry entries during installation. The parser, on the other hand, relies on those quotation marks to work correctly.

This means that the parser will read the string C:\Program Files\Windows NT\Accessories\Wordpad.exe as if it were the application C:\Program with the parameters Files\Windows and NT\Accessories\Wordpad.exe. Hence, it will display this warning when you try to delete or rename the C:\Program folder. It will also later change the path in the registry to the Recycle Bin or the new name for "c:\program".

WORK-AROUNDS

You can prevent the problem before it occurs with either of the following approaches:

After the problem has happened, there are several approaches to correcting the problem:


STATUS

Microsoft has confirmed this to be a problem in Windows NT version 4.0. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Keywords          : 
Version           : WinNT:4.0
Platform          : winnt 
Issue type        : kbbug 

Last Reviewed: February 22, 1999