Personalization Restore Classic File Explorer with Ribbon in Windows 11


File_Explorer_banner.png

This tutorial will show you how to restore the classic File Explorer with Ribbon for your account or all users in Windows 11.

File Explorer in Windows 10 has a ribbon, tabs, and a title bar with color. The ribbon includes common tasks, such as copying and moving, creating new folders, emailing and zipping items, and changing the view. The tabs change to show extra tasks that apply to the selected item. You can hide or show the ribbon on demand.

In Windows 11, Microsoft made File Explorer modern with a clean look and brand-new command bar instead of the ribbon.

If you prefer, you can restore the classic File Explorer with ribbon in Windows 11.


Contents

  • Option One: Temporarily Open File Explorer with Ribbon
  • Option Two: Create Shortcut to Always Open File Explorer with Ribbon
  • Option Three: Restore Classic File Explorer with Ribbon for Current User using REG file


EXAMPLE: File Explorer with command bar and ribbon in Windows 11

File_Explorer_with_command_bar.webp
File_Explorer_with_ribbon.png





Option One

Temporarily Open File Explorer with Ribbon


This option will open a File Explorer window with the ribbon.

You will be able to browse and navigate in this File Explorer window with a ribbon only for as long as this window is open.


1 Open the Control Panel.

2 Perform one of the following actions depending on which Control Panel view is used: (see screenshots below)
  • If using small icons view, click/tap twice on the Up arrow.
  • If using large icons view, click/tap twice on the Up arrow.
  • If using category view, click/tap once on the Up arrow.
Control_Panel_small_icons_view.png
Control_Panel_large_icons_view.png
Control_Panel_category_view.png

3 You will now have a File Explorer window with the ribbon open. (see screenshot below)

File_Explorer_window_with_ribbon.png





Option Two

Create Shortcut to Always Open File Explorer with Ribbon


You can Pin to Taskbar, Pin to Start, add to Start menu All apps, assign a keyboard shortcut to, or move this shortcut to where you like for easy usage.


If there's a folder or location you want File Explorer to open to by default that's not listed below, then please post a request for it. I'll be happy to add it to the shortcut list below for you.


The shortcut commands below will only work with an English language installation. If you use a different language, then please post a request for a translated version of the shortcut command you want to use. "Control Panel" and the folder name (ex: "Desktop") in the command needs to be translated for your language instead.



1 Create a new shortcut using the command below for the path you want:

Open File Explorer to Desktop with Ribbon
powershell.exe -nop -ep bypass -c "& {"Start-Process \"Control\"; $wshell = New-Object -ComObject wscript.shell; $null = $wshell.AppActivate(\"Control Panel\"); Start-Sleep 0.75; $wshell.SendKeys("'""^"lDesktop~"'")}"

OR

Open File Explorer to Home with Ribbon
powershell.exe -nop -ep bypass -c "& {"Start-Process \"Control\"; $wshell = New-Object -ComObject wscript.shell; $null = $wshell.AppActivate(\"Control Panel\"); Start-Sleep 0.75; $wshell.SendKeys("'""^"lHome~"'")}"

OR

Open File Explorer to OneDrive with Ribbon
powershell.exe -nop -ep bypass -c "& {"Start-Process \"Control\"; $wshell = New-Object -ComObject wscript.shell; $null = $wshell.AppActivate(\"Control Panel\"); Start-Sleep 0.75; $wshell.SendKeys("'""^"lShell:OneDrive~"'")}"

OR

Open File Explorer to This PC with Ribbon
powershell.exe -nop -ep bypass -c "& {"Start-Process \"Control\"; $wshell = New-Object -ComObject wscript.shell; $null = $wshell.AppActivate(\"Control Panel\"); Start-Sleep 0.75; $wshell.SendKeys("'""^"lThis PC~"'")}"




Option Three

Restore Classic File Explorer with Ribbon for Current User using REG file


This option will only work on Windows 11 version 23H2 and higher.


1 Do step 2 (classic) or step 3 (default - undo) below for what you would like to do.


 2. Restore Classic File Explorer with Ribbon for Current User

A) Click/tap on the Download button below to download the file below, and go to step 4 below.

Restore_classic_File_Explorer_with_ribbon_for_current_user.reg


(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0}]
@="CLSID_ItemsViewAdapter"

[HKEY_CURRENT_USER\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0}\InProcServer32]
@="C:\\Windows\\System32\\Windows.UI.FileExplorer.dll_"
"ThreadingModel"="Apartment"

[HKEY_CURRENT_USER\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33}]
@="File Explorer Xaml Island View Adapter"

[HKEY_CURRENT_USER\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33}\InProcServer32]
@="C:\\Windows\\System32\\Windows.UI.FileExplorer.dll_"
"ThreadingModel"="Apartment"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Toolbar\ShellBrowser]
"ITBar7Layout"=hex:13,00,00,00,00,00,00,00,00,00,00,00,20,00,00,00,10,00,01,00,\
  00,00,00,00,01,00,00,00,01,07,00,00,5e,01,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00


 3. Restore Modern File Explorer with Command Bar and Tabs for Current User

This is the default setting to undo step 2.


A) Click/tap on the Download button below to download the file below, and go to step 4 below.

Default_modern_File_Explorer_with_command_bar_for_current_user.reg


(Contents of REG file for reference)
Code:
Windows Registry Editor Version 5.00

[-HKEY_CURRENT_USER\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0}]

[-HKEY_CURRENT_USER\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33}]

4 Save the .reg file to your desktop.

5 Double click/tap on the downloaded .reg file to merge it.

6 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.

7 Either restart the explorer process, sign out and sign in, or restart the computer to apply.

8 You can now delete the downloaded .reg file if you like.


That's it,
Shawn Brink


 

Attachments

Last edited:
This is the list of the software I have installed on my machine (the list comes from ShellExView):
- QTTabBar
- Bandzip
- Malwarebytes
- Mega Sync
- Resillio Sync
- XnView
- Foxit Reader
- MS Office
- NVIDIA Shell Exensions
I only have Classic Explorer Bar (of Open-Shell's Classic Explorer component) and Gerhild Schinagl's famous-old Link Shell Extension. Some call me cocky, but usually, I know what's good! :D
 

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming F16 (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
I use QTTabBar Version 1038, no problems.
 

My Computers

System One System Two

  • OS
    Windows 11
    Computer type
    PC/Desktop
    Manufacturer/Model
    ASUS ROG Strix
  • Operating System
    Windows 11
    Computer type
    Laptop
    Manufacturer/Model
    ASUS VivoBook
  • Like
Reactions: jed

hope u can see it, it's from @dacrone's latest proposed solution, in the link. It's almost as bad on my end as shown on the X video.
That's definitely not normal. Even on my 4.5 year-old laptop (System 2 in my specs) it typically takes only about half a second to load the content pane in File Explorer (Windows 10 Ribbon). This is in spite of this being an older laptop with an Intel Core i5-1135G7 being limited by PCIe 3.0 speed for the 2TB Samsung 980 Pro and by DDR4-3200 CL22-22-22-52 single rank for the 2×8 GB dual channel G.Skill Ripjaws kit. I actually even have Intel Turbo Boost disabled on this laptop to slow down its CPU. With the Intel Core i7-13650HX with DDR5, System 1 in my specs mops the floor with it every day of the week and twice on Sundays. Loading the pane in File Explorer (also Windows 10 Ribbon) causes no significant delay.

I keep the Windows Search Indexer enabled, but I have removed all the various locations from its list (control srchadmin.dll).
 

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming F16 (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
Thanks @soewhaty. How are you keeping going with this? It drives me nuts.

Did someone decide to waste their life to reinstall their OS to see if the issue keeps going on fresh installation?
 
Last edited:

My Computer

System One

  • OS
    Windows 11 22H2
Issues started some 3-4 months ago. I dont have these installed on my machine

After nearly 2 months, I found the culprit.
On my PC the issue of laggy File Explorer was caused by Microsoft's Phone Link app, and it's feature that allows to view the storage of the mobile phone in the File Explorer.
Disabling the feature resolved the problem.
 

My Computer

System One

  • OS
    Windows 11 22H2
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0}]
@="CLSID_ItemsViewAdapter"

[HKEY_CURRENT_USER\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0}\InProcServer32]
@="C:\\Windows\\System32\\Windows.UI.FileExplorer.dll_"
"ThreadingModel"="Apartment"

[HKEY_CURRENT_USER\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33}]
@="File Explorer Xaml Island View Adapter"

[HKEY_CURRENT_USER\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33}\InProcServer32]
@="C:\\Windows\\System32\\Windows.UI.FileExplorer.dll_"
"ThreadingModel"="Apartment"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Toolbar\ShellBrowser]
"ITBar7Layout"=hex:13,00,00,00,00,00,00,00,00,00,00,00,20,00,00,00,10,00,01,00,\
00,00,00,00,01,00,00,00,01,07,00,00,5e,01,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00
@Brink, @LesFerch

I've done further testing on this reg file (it's the same one everyone reposts online). Turns out much of it is registry "fluff", and irrelevant to the actual hack. WinAero's Sergey Tkachenko probably provided the best explanation: Setting the two CLSID's to a bogus value causes Explorer to fail loading the new Ribbon overlay.

In reality, you don't even need a full path to a fake DLL. A null value works fine.

The shortest reg changes to make this work:
Code:
[HKEY_CURRENT_USER\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0}]

[HKEY_CURRENT_USER\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0}\InProcServer32]
@=""

[HKEY_CURRENT_USER\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33}]

[HKEY_CURRENT_USER\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33}\InProcServer32]
@=""

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Toolbar\ShellBrowser]
"ITBar7Layout"=hex:13,00,00,00,00,00,00,00,00,00,00,00,20,00,00,00,10,00,01,00,\
  00,00,00,00,01,00,00,00,01,07,00,00,5e,01,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
  00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00

While I don't think it's necessary to update the Tutorial, it's important to understand which parts of this solution are just "window dressing" or commentary.
 

My Computer

System One

  • OS
    Windows 7
In a batch file:

reg add HKCU\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0} /f reg delete HKCU\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0} /ve /f reg add HKCU\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0} /v InProcServer32 /t REG_SZ /f reg add HKCU\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33} /f reg delete HKCU\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33} /ve /f reg add HKCU\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33} /v InProcServer32 /t REG_SZ /f @setlocal enabledelayedexpansion @set a=00 @for /l %%i in (1,1,8) do @set a=!a!!a! @set a=13000000000000000000000020000000100001000000000001000000010700005e01!a!!a:~0,-2! reg add "HKCU\Software\Microsoft\Internet Explorer\Toolbar\ShellBrowser" /v ITBar7Layout /t REG_BINARY /d %a% /f @<nul set /p=Press any key to exit . . . @pause >nul
 
Last edited:

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming F16 (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
In a batch file:

reg add HKCU\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0} /f reg delete HKCU\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0} /ve /f reg add HKCU\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0} /v InProcServer32 /t REG_SZ /f reg add HKCU\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33} /f reg delete HKCU\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33} /ve /f reg add HKCU\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33} /v InProcServer32 /t REG_SZ /f @setlocal enabledelayedexpansion @set a=00 @for /l %%i in (1,1,8) do @set a=!a!!a! @set a=13000000000000000000000020000000100001000000000001000000010700005e01!a!!a:~0,-2! reg add "HKCU\Software\Microsoft\Internet Explorer\Toolbar\ShellBrowser" /v ITBar7Layout /t REG_BINARY /d %a% /f @<nul set /p=Press any key to exit . . . @pause >nul
"taskkill /f /im explorer.exe && start explorer" to make it take effect.
 

My Computer

System One

  • OS
    Windows 7
"taskkill /f /im explorer.exe && start explorer" to make it take effect.
I left that one out on purpose, as it kills all open File Explorer windows immediately, even if some operations might still be in progress.
 

My Computers

System One System Two

  • OS
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Asus TUF Gaming F16 (2024)
    CPU
    i7 13650HX
    Memory
    16GB DDR5
    Graphics Card(s)
    GeForce RTX 4060 Mobile
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    512GB SSD internal
    37TB external
    PSU
    Li-ion
    Cooling
    2× Arc Flow Fans, 4× exhaust vents, 5× heatpipes
    Keyboard
    Logitech K800
    Mouse
    Logitech G402
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
  • Operating System
    11 Home
    Computer type
    Laptop
    Manufacturer/Model
    Medion S15450
    CPU
    i5 1135G7
    Memory
    16GB DDR4
    Graphics card(s)
    Intel Iris Xe
    Sound Card
    Eastern Electric MiniMax DAC Supreme; Emotiva UMC-200; Astell & Kern AK240
    Monitor(s) Displays
    Sony Bravia XR-55X90J
    Screen Resolution
    3840×2160
    Hard Drives
    2TB SSD internal
    37TB external
    PSU
    Li-ion
    Mouse
    Logitech G402
    Keyboard
    Logitech K800
    Internet Speed
    20Mbit/s up, 250Mbit/s down
    Browser
    FF
why leave it out when its necessary? just add a pause and prompt to restart explorer, so that if anyone runs it by mistake they can wait to restart explorer until a good stopping point....

here fixed (+1 to restore win11 FE)

FEClassic.bat
Code:
@echo off
echo Creating registry entries...

:: Add registry keys
reg add "HKCU\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0}" /ve /t REG_SZ /d "CLSID_ItemsViewAdapter" /f
reg add "HKCU\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0}\InProcServer32" /ve /t REG_SZ /d "C:\Windows\System32\Windows.UI.FileExplorer.dll_" /f
reg add "HKCU\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0}\InProcServer32" /v "ThreadingModel" /t REG_SZ /d "Apartment" /f

reg add "HKCU\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33}" /ve /t REG_SZ /d "File Explorer Xaml Island View Adapter" /f
reg add "HKCU\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33}\InProcServer32" /ve /t REG_SZ /d "C:\Windows\System32\Windows.UI.FileExplorer.dll_" /f
reg add "HKCU\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33}\InProcServer32" /v "ThreadingModel" /t REG_SZ /d "Apartment" /f

echo.
echo Press any key to restart Explorer.exe for changes to take effect...
pause >nul

:: Restart Explorer
taskkill /f /im explorer.exe && start explorer

echo Done.
exit

FEWin11.bat
Code:
@echo off
echo Restoring Windows 11 File Explorer...

:: Remove registry modifications
reg delete "HKCU\Software\Classes\CLSID\{2aa9162e-c906-4dd9-ad0b-3d24a8eef5a0}" /f
reg delete "HKCU\Software\Classes\CLSID\{6480100b-5a83-4d1e-9f69-8ae5a88e9a33}" /f

echo.
echo Press any key to restart Explorer.exe for changes to take effect...
pause >nul

:: Restart Explorer
taskkill /f /im explorer.exe && start explorer

echo Windows 11 Explorer restored.
exit
 

My Computer

System One

  • OS
    Windows 11 Pro
Well, all of this seems like a lot of work, when you can easily get a full classic file manager/explorer using an option available in the latest version of Winaero. Please see attached pix. Good luck.
 

Attachments

  • 2025-06-06 12_03_05-Greenshot.webp
    2025-06-06 12_03_05-Greenshot.webp
    399.2 KB · Views: 1

My Computers

System One System Two

  • OS
    Windows 11 (24H2) Home
    Computer type
    PC/Desktop
    Manufacturer/Model
    HP Pavilion 577B5AA#ABA
    CPU
    Core(TM) i5-12400T
    Motherboard
    HP 89E9
    Memory
    12.0 GB (11.7 GB usable)
    Graphics Card(s)
    Intel(R) UHD Graphics 730
    Sound Card
    DFX Audio
    Monitor(s) Displays
    HO Generic PnP Monitor
    Screen Resolution
    1920 x 1080
    Hard Drives
    SAMSUNG MZVLQ10HBLB00BH1 SSD 1TB
    PSU
    HP Std. for this product
    Case
    All-in-One
    Cooling
    Fan
    Keyboard
    HP Wireless / Bluetooth
    Mouse
    HP Wireless / Bluetooth
    Internet Speed
    Link speed (Receive/Transmit): 1000/1000 (Mbps)
    Browser
    Firefox
    Antivirus
    Malwarebytes Pro / Windows Security
  • Operating System
    Windows 11 Home
    Computer type
    Laptop
    Manufacturer/Model
    HP 15tegooo [HP Pavilion Laptop Intel I-7]
    CPU
    Intel I-7-1165G7
    Motherboard
    HP
    Memory
    8 GB DDR4-3200 SDRAM
    Graphics card(s)
    Intel Iris Xe Graphics
    Sound Card
    Realtek
    Monitor(s) Displays
    HP HD micro edge, Bright View, 250 nits
    Screen Resolution
    1366 x768
    Hard Drives
    256 GB DD4-3200 SDRAM
    PSU
    HP
    Case
    Std HP Laptop
    Cooling
    Fan
    Mouse
    Logi M585
    Keyboard
    std
    Browser
    Edge
    Antivirus
    Windows Security
that uses a method that has hiccups and a slight delay. thus the desire for more fluent methods
 

My Computer

System One

  • OS
    Windows 11 Pro
InProcServer32 method doesn't work for 21H2. Instead you need the first method for "Shell Extensions\Blocked".

I realize many users don't care because they're on updated releases, but I had someone complain about 21H2 support.
 

My Computer

System One

  • OS
    Windows 7
InProcServer32 method doesn't work for 21H2. Instead you need the first method for "Shell Extensions\Blocked".

I realize many users don't care because they're on updated releases, but I had someone complain about 21H2 support.
good to know. wouldn't have realized that as i haven't touched 21 build in years lol
 

My Computer

System One

  • OS
    Windows 11 Pro
What annoys me is how many tech sites simply copy each other without doing actual testing. And some sites will never make later updates or corrections.

"This works for ALL W11". ummm No.
"This only works for 22H2, but not later releases". ummm No.

Bottom line: if you want to apply the changes to a new install, it must be done after first logon. Windows will clobber the same HKCU reg changes (except on 21H2, because it's HKLM) when applied to the Default User's profile.
 

My Computer

System One

  • OS
    Windows 7
What annoys me is how many tech sites simply copy each other without doing actual testing. And some sites will never make later updates or corrections.

"This works for ALL W11". ummm No.
"This only works for 22H2, but not later releases". ummm No.

Bottom line: if you want to apply the changes to a new install, it must be done after first logon. Windows will clobber the same HKCU reg changes (except on 21H2, because it's HKLM) when applied to the Default User's profile.

i made this back in March but never posted it. you or @LesFerch may get some use out of it or be able to make it better...

1749230291160.webp
1749230442513.webp
1749230308167.webp


you can choose a destination from the dropdown or enter a custom path in the line entry line below the dropdown. custom paths will be remembered below the list in the dropdown in future instances when you run it. you can check the auto launch box that will auto open the path when chosen from the dropdown, or leave it unchecked and manually launch it via Go button. the X deletes all stored custom paths. has light and dark modes.

configs are stored in .txt files located at:
%LocalAppData%\Local\RibUIEx

create a shorcut to the .ps1 and change the target in the shortcut properties to:
C:\Windows\System32\conhost.exe --headless powershell.exe -NoProfile -ExecutionPolicy Bypass -File "C:\path\to\RibbonUILauncher.ps1"

RibbonUILauncher.ps1

Code:
# Redirect all error output globally to surpress console errors
$ErrorActionPreference = "SilentlyContinue"

# Ensure the script is running in STA mode
if ([System.Threading.Thread]::CurrentThread.ApartmentState -ne [System.Threading.ApartmentState]::STA) {
    throw "Script must be run in Single Threaded Apartment (STA) mode. Use 'powershell -STA -File script.ps1'."
}

# Import necessary assemblies for GUI
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing

# Define paths for configuration
$localAppData = [System.Environment]::GetFolderPath('LocalApplicationData')
$configDir = Join-Path $localAppData "RibUIEx"
$configFile = Join-Path $configDir "config.txt"

# Ensure the configuration directory exists
if (-Not (Test-Path $configDir)) {
    New-Item -Path $configDir -ItemType Directory | Out-Null
}

# Set default values
$theme = "Dark"
$autoLaunch = $false
$checkboxChecked = $false

# Load settings from the configuration file
if (Test-Path $configFile) {
    try {
        $configContent = Get-Content -Path $configFile -Raw | ConvertFrom-Json
        if ($configContent.Theme -eq "Light" -or $configContent.Theme -eq "Dark") {
            $theme = $configContent.Theme
        }
        if ($configContent.AutoLaunch -eq $true -or $configContent.AutoLaunch -eq $false) {
            $autoLaunch = $configContent.AutoLaunch
        }
        if ($null -ne $configContent.CheckboxState) {
            $checkboxChecked = [bool]$configContent.CheckboxState
        }
    } catch {
        Write-Host "Error loading configuration, using defaults." # Debugging output
    }
} else {
    Write-Host "Config file not found, using defaults." # Debugging output
}

# Save the current configuration
function Save-Settings {
    param (
        [string]$currentTheme,
        [bool]$currentAutoLaunch,
        [bool]$isChecked
    )
    try {
        $settings = @{
            Theme = $currentTheme
            AutoLaunch = $currentAutoLaunch
            CheckboxState = $isChecked
        }
        $settings | ConvertTo-Json -Depth 1 | Set-Content -Path $configFile -Force
        Write-Host "Settings saved: Theme=$currentTheme, AutoLaunch=$currentAutoLaunch, Checkbox=$isChecked" # Debugging output
    } catch {
        Write-Host "Error saving settings: $($_.Exception.Message)" # Debugging output
    }
}
# Save settings when form is closing
$form.add_FormClosing({
    Save-Settings -currentTheme $theme -currentAutoLaunch $autoLaunch -isChecked $autoLaunchCheckbox.Checked
})


# Check for existing configuration file and read the theme
if (Test-Path $configFile) {
    $storedTheme = Get-Content -Path $configFile -Raw
    if ($storedTheme -match "Light") {
        $theme = "Light"
    }
}

# Create the tooltip instance
$tooltip = New-Object System.Windows.Forms.ToolTip
$tooltip.AutoPopDelay = 4000  # Time tooltip remains visible (in milliseconds)
$tooltip.InitialDelay = 2500 # Delay before tooltip appears after hovering (in milliseconds)
$tooltip.ReshowDelay = 10000   # Delay before re-showing tooltip after it disappears
$tooltip.ShowAlways = $true  # Ensure tooltips show even when the control is inactive

# Hide the console window
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class Win32 {
    [DllImport("user32.dll")]
    public static extern int ShowWindow(IntPtr hWnd, int nCmdShow);
    [DllImport("kernel32.dll")]
    public static extern IntPtr GetConsoleWindow();
}
"@

$consolePtr = [Win32]::GetConsoleWindow()
if ($consolePtr -ne [IntPtr]::Zero) {
    [Win32]::ShowWindow($consolePtr, 0) # 0 = Hide the console, 5 = Show the console
}

# Define the PathHistory directory and history file
$localAppData = [System.Environment]::GetFolderPath('LocalApplicationData')
$historyDir = Join-Path $localAppData "RibUIEx"
$historyFile = Join-Path $historyDir "ExPostHist.txt"

# Ensure the PathHistory directory exists
if (-Not (Test-Path $historyDir)) {
    New-Item -Path $historyDir -ItemType Directory | Out-Null
}

# Ensure the history file exists
if (-Not (Test-Path $historyFile)) {
    New-Item -Path $historyFile -ItemType File | Out-Null
}

# Import history into memory
$historyItems = Get-Content -Path $historyFile | Sort-Object | Where-Object { -Not [string]::IsNullOrWhiteSpace($_) }

# Function to show themed dialog
function Show-ThemedDialog {
    param (
        [string]$message,
        [string]$title,
        [bool]$isError
    )

    $dialogForm = New-Object System.Windows.Forms.Form
    $dialogForm.Text = $title
    $dialogForm.Width = 300
    $dialogForm.Height = 150
    $dialogForm.StartPosition = [System.Windows.Forms.FormStartPosition]::Manual

    # Calculate the center of the main form and position the dialog there
    $centerX = $form.Location.X + [Math]::Floor(($form.Width - $dialogForm.Width) / 2)
    $centerY = $form.Location.Y + [Math]::Floor(($form.Height - $dialogForm.Height) / 2)
    $dialogForm.Location = New-Object System.Drawing.Point($centerX, $centerY)

    $dialogForm.TopMost = $true
    $dialogForm.FormBorderStyle = [System.Windows.Forms.FormBorderStyle]::FixedDialog
    $dialogForm.MaximizeBox = $false
    $dialogForm.MinimizeBox = $false
    $dialogForm.BackColor = if ($theme -eq "Light") { [System.Drawing.Color]::White } else { [System.Drawing.Color]::Black }

    $messageLabel = New-Object System.Windows.Forms.Label
    $messageLabel.Text = $message
    $messageLabel.AutoSize = $true
    $messageLabel.ForeColor = if ($theme -eq "Light") { [System.Drawing.Color]::Black } else { [System.Drawing.Color]::White }
    $messageLabel.Font = New-Object System.Drawing.Font("Consolas", 11)
    $messageLabel.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter
    $verticalPosition = 25 # Set vertical position manually
    $messageLabel.Location = New-Object System.Drawing.Point(
    ([Math]::Floor(($dialogForm.ClientSize.Width - $messageLabel.PreferredWidth) / 2)), # Correctly center horizontally
    $verticalPosition # Use manually set vertical position
    )
    $dialogForm.Controls.Add($messageLabel)

    $okButton = New-Object System.Windows.Forms.Button
    $okButton.Text = "OK"
    $okButton.Size = New-Object System.Drawing.Size(85, 30)
    $okButton.BackColor = if ($theme -eq "Light") { [System.Drawing.Color]::White } else { [System.Drawing.Color]::Black }
    $okButton.ForeColor = if ($theme -eq "Light") { [System.Drawing.Color]::Black } else { [System.Drawing.Color]::White }
    $okButton.Font = New-Object System.Drawing.Font("Consolas", 11)
    $verticalPosition = 65 # Set vertical position manually
    $okButton.Location = New-Object System.Drawing.Point(
    ([Math]::Floor(($dialogForm.ClientSize.Width - $okButton.Width) / 2)), # Correctly center horizontally
    $verticalPosition # Use manually set vertical position
    )

    $okButton.Add_Click({ $dialogForm.Close() })
    $dialogForm.Controls.Add($okButton)

    $dialogForm.ShowDialog()
}

# Create a form
$form = New-Object System.Windows.Forms.Form
$form.Text = "Ribbon UI Explorer Launcher"
$form.Width = 400
$form.Height = 275

# Center the form on the screen
$form.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterScreen
$form.TopMost = $true # Always in front
$form.BackColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::White
} else {
    [System.Drawing.Color]::Black
}

$form.Add_Shown({
    Start-Sleep -Milliseconds 100

    # Calculate the coordinates of the dropdown arrow relative to the screen
    $comboBoxArrowX = $form.Location.X + $dropdown.Location.X + $dropdown.Width - 8
    $comboBoxArrowY = $form.Location.Y + $dropdown.Location.Y + [Math]::Floor($dropdown.Height / 2) + 22 # Add 5 pixels for a slight downward adjustment

    # Move the cursor to the adjusted position
    [System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($comboBoxArrowX, $comboBoxArrowY)
})

# Lock the dimensions of the main form
$form.FormBorderStyle = [System.Windows.Forms.FormBorderStyle]::FixedDialog
$form.MaximizeBox = $false
$form.MinimizeBox = $false

# Set font to Consolas 11pt
$font = New-Object System.Drawing.Font("Consolas", 11)

# Add a label for the dropdown
$dropdownLabel = New-Object System.Windows.Forms.Label
$dropdownLabel.Text = "Choose Destination Path:"
$dropdownLabel.AutoSize = $true
$dropdownLabel.ForeColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::Black
} else {
    [System.Drawing.Color]::White
}
$dropdownLabel.Font = $font
$dropdownLabel.Location = New-Object System.Drawing.Point(40, 10)
$form.Controls.Add($dropdownLabel)

# Create a dropdown (ComboBox)
$dropdown = New-Object System.Windows.Forms.ComboBox
$dropdown.Width = 300
$dropdown.Location = New-Object System.Drawing.Point(40, 40)
$dropdown.BackColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::White
} else {
    [System.Drawing.Color]::Black
}
$dropdown.ForeColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::Black
} else {
    [System.Drawing.Color]::White
}
$dropdown.Font = $font
$dropdown.DropDownStyle = [System.Windows.Forms.ComboBoxStyle]::DropDownList # Only dropdown selection allowed

# Define known CLSIDs to the dropdown
$clsids = @{
    "This PC" = "shell:::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
    "C:\ (or SystemDrive)" = "%systemdrive%\"
    "User Folder" = "shell:::{59031a47-3f72-44a7-89c5-5595fe6b30ee}"
    "SystemDrive\Windows\System32" = "%windir%\System32"
    "Desktop" = "shell:::{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}"
    "Documents" = "shell:::{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}"
    "Downloads" = "shell:::{088e3905-0323-4b02-9826-5d99428e115f}"
    "Music" = "shell:::{1CF1260C-4DD0-4ebb-811F-33C572699FDE}"
    "Pictures" = "shell:::{24ad3ad4-a569-4530-98e1-ab02f9417aa8}"
    "Videos" = "shell:::{A0953C92-50DC-43bf-BE83-3742FED03C9C}"
    "Home" = "shell:::{F874310E-B6B7-47DC-BC84-B9E6B38F5903}"
    "Gallery" = "shell:::{E88865EA-0E1C-4E20-9AA6-EDCD0212C87C}"
    "Libraries" = "shell:::{031E4825-7B94-4dc3-B131-E946B44C8DD5}"
    "Recycle Bin" = "shell:::{645FF040-5081-101B-9F08-00AA002F954E}"

}

# Populate Dropdown Alphabetically by Stored Name
$sortedKeys = $clsids.Keys | Sort-Object | ForEach-Object { $_ } # Ensure Explicit Array-Like Output
$dropdown.Items.AddRange($sortedKeys)

# Add separator line to indicate imported paths
$separator = "-" * 37
$dropdown.Items.Add($separator)

# Import history into the dropdown and show actual paths
foreach ($item in $historyItems) {
    $dropdown.Items.Add($item) # Add actual path directly
}

# Add the dropdown to the form
$form.Controls.Add($dropdown)

# Attach event to update the tooltip dynamically based on selected item
$dropdown.add_SelectedIndexChanged({
    # Get the currently selected item
    $selectedItem = $dropdown.SelectedItem

    # Check if the selected item is a custom path (not CLSID and not the separator)
    if (-not [string]::IsNullOrWhiteSpace($selectedItem) -and -not $clsids.ContainsKey($selectedItem) -and $selectedItem -ne $separator) {
        # Show tooltip for custom paths
        $tooltip.SetToolTip($dropdown, "Custom Path: $selectedItem")
    } else {
        # Clear tooltip for predefined paths or separators
        $tooltip.SetToolTip($dropdown, "")
    }
})

# Ensure the tooltip is updated and only shown after the dropdown closes
$dropdown.add_DropDownClosed({
    $selectedItem = $dropdown.SelectedItem

    # Refresh tooltip only for custom paths
    if (-not [string]::IsNullOrWhiteSpace($selectedItem) -and -not $clsids.ContainsKey($selectedItem) -and $selectedItem -ne $separator) {
        $tooltip.SetToolTip($dropdown, "Custom Path: $selectedItem")
    } else {
        # Clear tooltip for predefined paths or separators
        $tooltip.SetToolTip($dropdown, "")
    }
})

# Create Checkbox (Remove Label Text)
$autoLaunchCheckbox = New-Object System.Windows.Forms.CheckBox
$autoLaunchCheckbox.Text = "" # Remove text from the checkbox
$autoLaunchCheckbox.AutoSize = $false # Allows manual resizing
$autoLaunchCheckbox.Size = New-Object System.Drawing.Size(16, 16) # Adjust size of checkbox
$autoLaunchCheckbox.Location = New-Object System.Drawing.Point(275, 157)
$autoLaunchCheckbox.TabIndex = 5  # Fifth in tab order

$autoLaunchCheckbox.Checked = $checkboxChecked # Load the saved state
$form.Controls.Add($autoLaunchCheckbox)

# Attach event to save checkbox state
$autoLaunchCheckbox.add_CheckedChanged({
    Save-Settings -currentTheme $theme -currentAutoLaunch $autoLaunch -isChecked $autoLaunchCheckbox.Checked
})

# Add a New Label for the Checkbox
$autoLaunchLabel = New-Object System.Windows.Forms.Label
$autoLaunchLabel.Text = " Auto`nLaunch"
$autoLaunchLabel.AutoSize = $true
$autoLaunchLabel.ForeColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::Black
} else {
    [System.Drawing.Color]::White
}
$autoLaunchLabel.Font = New-Object System.Drawing.Font("Consolas", 9)
$autoLaunchLabel.Location = New-Object System.Drawing.Point(260, 183)

$form.Controls.Add($autoLaunchLabel)

# Update dropdown selection event to handle Auto Launch
$dropdown.add_SelectedIndexChanged({
    $selectedItem = $dropdown.SelectedItem
    # Prevent action when the separator is selected
    if ($selectedItem -eq $separator) {
        $dropdown.SelectedIndex = -1 # Reset selection
        return
    }

    # Check if Auto Launch is enabled
    if ($autoLaunchCheckbox.Checked) {
        $okButton.PerformClick() # Simulate pressing the OK button
    }
})

# Handle the dropdown selection event
$dropdown.add_SelectedIndexChanged({
    $selectedItem = $dropdown.SelectedItem
    # Prevent action when the separator is selected
    if ($selectedItem -eq $separator) {
        # Ignore clicks on the separator
        $dropdown.SelectedIndex = -1 # Reset selection
        return
    }
})

# Add label for custom path text box
$customPathLabel = New-Object System.Windows.Forms.Label
$customPathLabel.Text = "Specify Custom Destination Path:"
$customPathLabel.AutoSize = $true
$customPathLabel.ForeColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::Black
} else {
    [System.Drawing.Color]::White
}
$customPathLabel.Font = $font
$customPathLabel.Location = New-Object System.Drawing.Point(40, 80)
$form.Controls.Add($customPathLabel)

# Create a text field for custom path input (always visible now)
$customPathTextBox = New-Object System.Windows.Forms.TextBox
$customPathTextBox.Width = 300
$customPathTextBox.Location = New-Object System.Drawing.Point(40, 110)
$customPathTextBox.TabIndex = 1  # First in tab order
$customPathTextBox.BackColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::White
} else {
    [System.Drawing.Color]::Black
}
$customPathTextBox.ForeColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::Black
} else {
    [System.Drawing.Color]::White
}
$customPathTextBox.Font = $font
$form.Controls.Add($customPathTextBox)

# Add a vertical sliding toggle switch for theme (Light/Dark mode)
$themePanel = New-Object System.Windows.Forms.Panel
$themePanel.Width = 25
$themePanel.Height = 64
$themePanel.Location = New-Object System.Drawing.Point(70, 150)
$themePanel.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#303030")
$themePanel.BorderStyle = [System.Windows.Forms.BorderStyle]::FixedSingle
$form.Controls.Add($themePanel)

$toggleButton = New-Object System.Windows.Forms.Label
$toggleButton.Width = 21
$toggleButton.Height = 30
$toggleButton.TabIndex = 2  # Second in tab order
$toggleButton.Location = New-Object System.Drawing.Point(1, 1) # Positioned at the top for Light mode
$toggleButton.Location = if ($theme -eq "Light") {
    New-Object System.Drawing.Point(1, 1) # Light mode position
} else {
    New-Object System.Drawing.Point(1, 30) # Dark mode position
}
$toggleButton.BackColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::White
} else {
    [System.Drawing.Color]::Black
}
$toggleButton.ForeColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::White
} else {
    [System.Drawing.Color]::Black
}
$toggleButton.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter
$toggleButton.Text = $theme
$toggleButton.Font = $font
$themePanel.Controls.Add($toggleButton)

# Add tooltip for toggleButton button
$tooltip.SetToolTip($toggleButton, "Toggle Light/Dark Theme")

# Add toggle functionality
$toggleButton.Add_Click({
    if ($toggleButton.Text -eq "Light") {
        # Change to Dark Mode
        $toggleButton.Text = "Dark"
        $toggleButton.BackColor = [System.Drawing.Color]::Black
        $toggleButton.ForeColor = [System.Drawing.Color]::Black
        $toggleButton.Location = New-Object System.Drawing.Point(1, 30) # Move toggle to the bottom
        $form.BackColor = [System.Drawing.Color]::Black
        $dropdownLabel.ForeColor = [System.Drawing.Color]::White
        $customPathLabel.ForeColor = [System.Drawing.Color]::White
        $dropdown.BackColor = [System.Drawing.Color]::Black
        $dropdown.ForeColor = [System.Drawing.Color]::White
        $customPathTextBox.BackColor = [System.Drawing.Color]::Black
        $customPathTextBox.ForeColor = [System.Drawing.Color]::White
        $deleteHistoryButton.BackColor = [System.Drawing.Color]::Black
        $deleteHistoryButton.ForeColor = [System.Drawing.Color]::Red
        $okButton.BackColor = [System.Drawing.Color]::Black
        $okButton.ForeColor = [System.Drawing.Color]::Lime
        $autoLaunchLabel.ForeColor = [System.Drawing.Color]::White # Update label text color
        $theme = "Dark"
        Set-Content -Path $configFile -Value $theme # Save preference to config file
    } else {
        # Change to Light Mode
        $toggleButton.Text = "Light"
        $toggleButton.BackColor = [System.Drawing.Color]::White
        $toggleButton.ForeColor = [System.Drawing.Color]::White
        $toggleButton.Location = New-Object System.Drawing.Point(1, 1) # Move toggle to the top
        $form.BackColor = [System.Drawing.Color]::White
        $dropdownLabel.ForeColor = [System.Drawing.Color]::Black
        $customPathLabel.ForeColor = [System.Drawing.Color]::Black
        $dropdown.BackColor = [System.Drawing.Color]::White
        $dropdown.ForeColor = [System.Drawing.Color]::Black
        $customPathTextBox.BackColor = [System.Drawing.Color]::White
        $customPathTextBox.ForeColor = [System.Drawing.Color]::Black
        $deleteHistoryButton.BackColor = [System.Drawing.Color]::White
        $deleteHistoryButton.ForeColor = [System.Drawing.Color]::Red
        $okButton.BackColor = [System.Drawing.Color]::White
        $okButton.ForeColor = [System.Drawing.Color]::Green
        $autoLaunchLabel.ForeColor = [System.Drawing.Color]::Black # Update label text color
        $theme = "Light"
        Set-Content -Path $configFile -Value $theme # Save preference to config file
    }
})

## Add "Delete Custom History" button
$deleteHistoryButton = New-Object System.Windows.Forms.Button
$deleteHistoryButton.Text = "x"
$deleteHistoryButton.TextAlign = [System.Drawing.ContentAlignment]::MiddleCenter
$deleteHistoryButton.Location = New-Object System.Drawing.Point(155, 190)
$deleteHistoryButton.Size = New-Object System.Drawing.Size(50, 25)
$deleteHistoryButton.BackColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::White
} else {
    [System.Drawing.Color]::Black
}
$deleteHistoryButton.ForeColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::Red
} else {
    [System.Drawing.Color]::Red
}
$deleteHistoryButton.Font = $font
$deleteHistoryButton.TabIndex = 4  # Fourth in tab order

# Add functionality to delete history and refresh dropdown
$deleteHistoryButton.Add_Click({
    if (Test-Path $historyFile) {
        Remove-Item $historyFile -Force
        Show-ThemedDialog -message "Custom Paths Deleted" -title "Success" -isError $false

        # Refresh the dropdown list after deletion
        $dropdown.Items.Clear() # Clear existing items
        $dropdown.Items.AddRange($clsids.Keys) # Repopulate with predefined CLSIDs
    } else {
        Show-ThemedDialog -message "No Custom Paths to Delete" -title "Error" -isError $true
    }
})

# Add the Delete Custom History button to the form
$form.Controls.Add($deleteHistoryButton)

# Add tooltip for deleteHistory button
$tooltip.SetToolTip($deleteHistoryButton, "Delete Stored Custom Paths")

# Create an OK button
$okButton = New-Object System.Windows.Forms.Button
$okButton.Text = ">"
$okButton.Location = New-Object System.Drawing.Point(155, 150)
$okButton.Size = New-Object System.Drawing.Size(50,25)
$okButton.BackColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::White
} else {
    [System.Drawing.Color]::Black
}
$okButton.ForeColor = if ($theme -eq "Light") {
    [System.Drawing.Color]::Green
} else {
    [System.Drawing.Color]::Lime
}
$okButton.Font = $font
$okButton.TabIndex = 3  # Third in tab order

# Add functionality to the OK button
$okButton.Add_Click({
    # Determine the selected path
    if ($dropdown.SelectedItem) {
        if ($clsids.ContainsKey($dropdown.SelectedItem)) {
            $selectedCLSID = $clsids[$dropdown.SelectedItem]
        } else {
            $selectedCLSID = $dropdown.SelectedItem
        }
    } else {
        $selectedCLSID = $customPathTextBox.Text
    }

    # Check if path is empty
    if ([string]::IsNullOrWhiteSpace($selectedCLSID)) {
        Show-ThemedDialog -message "Please Specify a Path" -title "Error" -isError $true
        return
    }

    # Attempt to resolve environmental variables in the path
    try {
        $resolvedPath = [System.Environment]::ExpandEnvironmentVariables($selectedCLSID)
    } catch {
        Show-ThemedDialog -message "Error resolving environment variables: $selectedCLSID" -title "Error" -isError $true
        return
    }

    # Validate the path
    $isValidPath = ($clsids.ContainsValue($resolvedPath)) -or
                   ((-not [string]::IsNullOrWhiteSpace($resolvedPath)) -and (Test-Path $resolvedPath)) -or
                   ($resolvedPath -like '::{*}') -and
                   ($resolvedPath -match ':') # Ensure the path contains a colon

    if (-not $isValidPath) {
        Show-ThemedDialog -message "Invalid Path Specified" -title "Error" -isError $true
        return
    }


    # Save the custom path to the history file if valid
    if ((-not [string]::IsNullOrWhiteSpace($customPathTextBox.Text)) -and
        ($customPathTextBox.Text -notlike '::{*}')) {
        try {
            Add-Content -Path $historyFile -Value $customPathTextBox.Text
        } catch {
            Show-ThemedDialog -message "Error saving history: $historyFile" -title "Error" -isError $true
            return
        }
    }

    try {
        # Launch the valid path through the Control Panel shell
        $shellApp = New-Object -ComObject Shell.Application
        $controlPanelWindow = $shellApp.Windows() | Where-Object {
            $_.Document.Folder.Self.Path -eq "::{26EE0668-A00A-44D7-9371-BEB064C98683}"
        }

        if (-not $controlPanelWindow) {
            $shellApp.Open("::{26EE0668-A00A-44D7-9371-BEB064C98683}")
            Start-Sleep -Milliseconds 800
            $controlPanelWindow = $shellApp.Windows() | Where-Object {
                $_.Document.Folder.Self.Path -eq "::{26EE0668-A00A-44D7-9371-BEB064C98683}"
            }
        }

        if ($controlPanelWindow) {
            $controlPanelWindow.Navigate($resolvedPath)

            # Get the monitor where the cursor is currently located
            $mousePosition = [System.Windows.Forms.Cursor]::Position
            $monitor = [System.Windows.Forms.Screen]::FromPoint($mousePosition)
            $monitorBounds = $monitor.Bounds

            # Determine the best dimensions
            if ($monitorBounds.Width -ge 1300 -and $monitorBounds.Height -ge 935) {
                $windowWidth = 1300
                $windowHeight = 935
            } else {
                $windowWidth = 1100
                $windowHeight = 635
            }

            # Calculate center position on the current monitor
            $centerX = $monitorBounds.X + [Math]::Floor(($monitorBounds.Width - $windowWidth) / 2)
            $centerY = $monitorBounds.Y + [Math]::Floor(($monitorBounds.Height - $windowHeight) / 2)

            # Apply dimensions and position to the Explorer window
            $controlPanelWindow.Width = $windowWidth
            $controlPanelWindow.Height = $windowHeight
            $controlPanelWindow.Left = $centerX
            $controlPanelWindow.Top = $centerY

            # Send the ESC key to close any active search or pop-ups
            [System.Windows.Forms.SendKeys]::Send("{ESC}")
            [System.Windows.Forms.SendKeys]::Send("{ESC}")
            [System.Windows.Forms.SendKeys]::Send("{ESC}")
        } else {
            Show-ThemedDialog -message "Failed to open Control Panel shell." -title "Error" -isError $true
        }
    } catch {
        Show-ThemedDialog -message "Error navigating to: $resolvedPath." -title "Error" -isError $true
    }

    $form.Close()
})

# Add the OK button to the form
$form.Controls.Add($okButton)

# Attach KeyDown event to the text box
$customPathTextBox.Add_KeyDown({
    if ($_.KeyCode -eq [System.Windows.Forms.Keys]::Return) {
        $okButton.PerformClick() # Simulate a click on the OK button
    }
})

# Add tooltip for OK button
$tooltip.SetToolTip($okButton, "Launch Selected Path")

# Show the form
$form.ShowDialog()
 
Last edited:

My Computer

System One

  • OS
    Windows 11 Pro
Back
Top Bottom