On 64-bit Windows versions, some files and folders shown by Windows Explorer are not shown by Total Commander!

From TotalcmdWiki
Revision as of 22:07, 23 March 2012 by White (talk | contribs) (Exceptions to the redirection rule: Removed duplicate word "there".)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

When using a 64-bit Windows version, Total Commander may show different folder contents for certain folders than Windows Explorer. This page describes why this happens and how it can be solved.

About the problem

Affected Windows versions

You experience this problem on one of the following Windows versions:

  • Windows XP 64-bit
  • Windows 2003 64-bit
  • Windows Vista 64-bit
  • Windows Server 2008 64-bit
  • Windows 7 64-bit


Affected files and folders

This problem affects files and folders which are located inside %windir%\system32 or inside subfolders of %windir%\system32. A file for which this problem is reported frequently is the hosts file, i.e. %windir%\system32\drivers\etc\hosts.

Note:
%windir% is a variable which holds the name of the Windows folder. In most cases, %windir% will be C:\Windows.


What causes this problem?

Your Windows version is 64-bit. Total Commander up to the current version at the time of writing this is a 32-bit application.

Please, find a brief explanation on how 64-bit Windows versions run 32-bit applications here:

As the Microsoft articles explain, Windows 64-bit versions will redirect any request of a 32-bit program like e.g. Total Commander to access %windir%\system32 to a folder named %windir\SysWOW64. But the 32-bit program will believe it actually sees %windir%\system32.

As a matter of fact the folders %windir%\system32 and %windir%\SYSWOW64 do not hold the same sub-folders and the same files.

Keep in mind:
Navigating to %windir% => system32 will trigger the Wow64 folder redirection and actually take you to %windir% => SysWoW64 instead, provided you are using Total Commander or any other 32-bit application.


Exceptions to the redirection rule

A small number of folders will not be redirected to the %windir%\SysWOW64 foldertree:

  •  %windir%\system32\catroot
  •  %windir%\system32\catroot2
  •  %windir%\system32\drivers\etc
  •  %windir%\system32\logfiles
  •  %windir%\system32\spool

On Windows 7 64-bit and Windows 2008 R2 64-bit:

  •  %windir%\system32\driverstore

will not be redirected, either.
Please, keep in mind that 64-bit redirection subsystem does not "remember" navigation history. Each request for file/directory listing is completely independent. So, if you navigate from %windir% to system32, you end up in SysWOW64. But then if you then try to open catroot, you will get the contents not of %windir%\SysWOW64\catroot, but of the real %windir%\system32\catroot, because this particular path is not redirected, no matter how you got there.

Of course, if you try to open %windir%\SysWOW64\catroot directly, not via system32, you will get the contents of the %windir%\SysWOW64\catroot directory.

Solutions

Using the hidden alias SYSNATIVE

Starting with Vista 64-bit, Microsoft introduced a workaround for the file and folder redirection. This workaround is available to all 32-bit applications running on

  • Windows Server 2008 64-bit
  • Windows 7 64-bit
  • Windows Vista 64-bit
  • Windows 2003 64-bit with Hotfix KB942589 installed
  • Windows XP 64-bit with Hotfix KB942589 installed

On the listed Windows versions, there is an invisible alias name SysNative which points to system32. Only 32-bit applications can use the alias SysNative. If a 32-bit application requests to access %windir%\Sysnative it will not be redirected to SysWOW64 instead, but it will access the real %windir%system32 folder.

Using the alias SysNative is the recommended way of accessing the real system32 folder.
Therefore, Total Commander 7.50 and above will display the invisible alias Sysnative inside %windir% as if it were a normal folder thus making it easy to use this alias.

So in Total Commander you navigate to %windir% => Sysnative. This will take you to the genuine %windir%\system32 folder.
Navigating to %windir% => system32, however, will trigger the Wow64 folder redirection and actually take you to %windir% => SysWoW64.

Using SysNative will work out of the box provided you are using Total Commander v7.50a or higher on

  • Windows Server 2008 64-bit
  • Windows 7 64-bit
  • Windows Vista 64-bit.

Using SysNative will also work provided you are using Total Commander v7.50a or higher on


Using X64DisableRedirection (temporarily)

Starting with the version 7.0, Total Commander offers a configuration parameter X64DisableRedirection. By default, this parameter has got the value 0, i.e. Windows system file and folder redirection is not disabled (=enabled). You can, however, add the parameter X64DisableRedirection=1 to the section [Configuration], thus disabling Windows system file and folder redirection for Total Commander.

Beware:
Doing so permanently, will inevitably lead to problems with plugins which try to load DLLs from the system32 folder and now try to load the 64-bit DLLs instead of the 32-bit DLLs located in SysWOW64.

Therefore, if you wish to or have to disable the Windows system file and folder redirection, do so temporarily only by using the Total Commander internal command cm_SwitchX64Redirection. This internal command has been introduced by Total Commander 7.50.

Disabling/re-enabling the X64 Redirection will work provided you are using Total Commander v7.0 or higher on

  • Windows XP 64-bit
  • Windows 2003 64-bit
  • Windows Vista 64-bit
  • Windows Server 2008 64-bit
  • Windows 7 64-bit


Using reparse points

Another way of working around the file and folder redirection to which Microsoft subjects any 32-bit application on 64-bit Windows is by using reparse points - junctions or symbolic links (new in Windows Vista).

If a 32-bit application uses a reparse point which points to %windir%\system32 in order to access the folder %windir%\system32, in this case no redirection to %windir%\SysWow64 will occur.

So users can use e.g. internal mklink command line command or Sysinternals junction tool and create a junction inside the folder %windir% named e.g. system64 which points to the real system32 folder.

From now on in Total Commander you navigate to %windir% => system64. This will take you to the genuine %windir%\system32 folder.
Navigating to %windir% => system32, however, will trigger the Wow64 folder redirection and actually take you to %windir% => SysWoW64 instead.

Beware:
On Windows versions older than Vista, Explorer will delete the content of the target folder if you try to delete the junction. Total Commander can tell the reparse point and the target folder apart.

Working around the described problem with the help of reparse points will work on

  • Windows XP 64-bit
  • Windows 2003 64-bit
  • Windows Vista 64-bit
  • Windows Server 2008 64-bit
  • Windows 7 64-bit


Further reading

Total Commander Forum

This problem has been extensively reported and discussed in the official Total Commander Forum. If you use the forum search button and search for the strings

  • X64DisableRedirection and
  • SysNative and
  • system32\drivers\etc

you should get a list of about 60 different threads, at least half of them in English.
Note:
You will have to perform 3 separate searches, 1 for each search string in order to get the 60 hits, if you use the forum default search option Search for all terms.


Referenced Microsoft articles




Back to Problems and Incompatibilities