Q. When you double-click a folder in Windows XP SP2 (Service Pack 2) the folder does not open and displays the Search Results window?

When you double-click a folder in Windows XP explorer, it is supposed to expand (open) the folder. Your Windows XP SP2 (Service Pack 2) computer displays the Search Results window instead.

NOTE: When you right-click the folder and press Open, the folder expands successfully.

This behavior will occur if a registry entry in HKEY_CLASSES_ROOT\Directory\shell is corrupted.

I have scripted DirShell.bat and DirShell.reg to resolve this issue.

The syntax for using DirShell.bat is:

DirShell FolderName

Where FolderName is the fully qualified folder name where a backup of the existing HKEY_CLASSES_ROOT\Directory\shell registry entries will be created, as DirShellOld.reg.

NOTE: After running DirShell.bat, you MUST shutdown and restart Windows XP.

NOTE: DirShell.bat and DirShell.reg must be placed in the same folder.

DirShell.REG contains:




@="Open Command Window Here"

@="cmd.exe /k \"cd %L\""


@=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,45,78,70,6c,6f,72,65,72,2e,65,  78,65,00

@="\[FindFolder(\"%l\", %I)\]"



DirShell.bat contains:
@echo off
if \{%1\}==\{\} @echo Syntax: DirShell Folder&goto :EOF
if not exist %1 @echo Syntax: DirShell - %1 does NOT exist.&goto :EOF
if not exist "%~DP0DirShell.REG" @echo "%~DP0DirShell.REG" does NOT exist.&goto :EOF
set folder=%1#
set folder=%folder:"=%
set folder=%folder:\#=%
set folder=%folder:#=%
if exist "%folder%\DirShellOld.reg" del /q "%folder%\DirShellOld.reg"
regedit /a "%folder%\DirShellOld.reg" "HKEY_CLASSES_ROOT\Directory\shell"
regedit /s "%~DP0DirShell.REG"

Hide 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.