microsoft / microsoft/PowerToys

Preview Visual Studio .mpl files

Open
#49,396 0 comments 0 reactions 0 assignees View on GitHub
Needs-Triage Product-File Explorer
Dominant language
C
Stars
139k
Forks
8.6k
PR merge metrics
PR metrics pending

Description

### Description of the new feature / enhancement

Hello I use Visual Studio. I see that .json files can be previewed. In VS I use a code editor for Maple. The files are saved with a .mpl extension. These do not preview in Widouws Explorer. Could you possible add a feature that would allow one to add variours extensions as the are many file extensions that can be saved from VS.

### Scenario when this would be used?

For quickly looking at files when searching in Windous Explorer

### Supporting information

I tried getting Google AI to solve this but no success. There is the chat.

You are completely right. Treating .mpl like a bloated Maple binary file is unnecessary since it is already pure text.The reason Windows is still showing "No preview available" despite our registry edits is because Windows maintains a secondary, hidden file association database specifically for users. This database overrides everything else we did.We can completely wipe out that stubborn block and force Windows to treat .mpl files exactly like a .txt file using the native Windows command tool.The True Plain-Text ResetPress the Windows Key, type cmd, right-click Command Prompt, and select Run as administrator.Copy and paste this command to clear out the stubborn user block, and press Enter:cmdreg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mpl" /f
Use code with caution.(If it says "the system was unable to find...", that is fine. It means the path is already clear).Next, copy and paste this command to tell Windows that .mpl belongs directly to the native text compiler system, and press Enter:cmdassoc .mpl=txtfile
Use code with caution.Restart File Explorer to ApplyRight-click an empty space on your Taskbar and select Task Manager.Scroll down the Processes tab, find Windows Explorer, right-click it, and select Restart.Open your folder and click a .mpl file. Because Windows now sees it as a member of the standard txtfile family, the PowerToys preview pane will natively load your plain text source code with scrolling support.Let me know if your code finally maps onto the screen!AI responses may include mistakes. [Learn more](https://www.google.com/url?sa=i&source=web&rct=j&url=https://support.google.com/websearch?p%3Daimode&ved=2ahUKEwjB26CVhNyVAxVeU0EAHa9fExgQx6APegkIAggBCPUFEAE&opi=89978449&cd&psig=AOvVaw39JiLtTwQnSmnWxKOHNl3x&ust=1784457451245000)You said: ERROR: Delete request is partially completed.ERROR: Delete request is partially completed.21:10The "partially completed" error means Windows cleared out the main block but is actively protecting a subfolder called UserChoice because a specific program (like Visual Studio or Notepad) has a firm grip on it.We can break that lock instantly by using a deep-registry command that forces Windows to drop its permissions and treat .mpl exactly like a standard text document.The Forced ResetPress the Windows Key, type cmd, right-click Command Prompt, and select Run as administrator.Copy and paste this exact command to completely wipe the user block path, then press Enter:cmdreg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.mpl\UserChoice" /f
Use code with caution.Copy and paste this second command to force your user profile to use the text compiler engine, and press Enter:cmdreg add "HKCU\Software\Classes\.mpl" /ve /t REG_SZ /d "txtfile" /f
Use code with caution.Apply the ChangesRight-click an empty space on your Taskbar and select Task Manager.Scroll down the Processes tab, find Windows Explorer, right-click it, and select Restart.Open your folder and click a .mpl file. By routing it through the native txtfile architecture at the user profile level, File Explorer will bypass the error and load your plain text source code.Let me know if this clears the error and loads the code onto the screen!AI responses may include mistakes. Learn more2 sitesERROR: 'The installation was interrupted ... Service Sage 50 Accounts Service could not be stopped...'Close the error message. Press the Windows Key and type cmd. Right-click Command Prompt and click Run as administrator.gb-kb.sage.comHow can I delete file that says "the action can't be completed because the file is open in download manager for audible content" - Microsoft Q&AIn the Processes tab, scroll down the list until you find Windows Explorer. Right-click on it and select Restart. Then wait a coup...Microsoft LearnYou said: didn't workdidn't work2[1](https://gb-kb.sage.com/portal/app/portlets/results/view2.jsp?k2dockey=200427112435970):12The reason your .mpl files are completely locked out of the Windows Text Preview Handler is a known security rule built into Windows 10 and 11. Windows strictly refuses to preview custom text extensions if the file extension does not match standard plaintext values like .txt, .log, or .bat, completely ignoring global registry edits.To force Windows to preview your .mpl files cleanly as plain text without adding a duplicate file or touching your automated code loop, you can add an official system link between the two file extensions.Step [1](https://learn.microsoft.com/en-my/answers/questions/709727/how-can-i-delete-file-that-says-the-action-cant-be): Create a Direct Registry File RedirectionThis method bypasses the locked UserChoice profile block by redirecting how File Explorer matches the .mpl format right at the core system level.Press Windows Key + R, type regedit, and press Enter to open the Registry Editor.Navigate to this exact folder path in the left pane:HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.mplLook at the right panel. Double-click the entry named (Default) at the very top.Change its Value Data to exactly: txtfileClick OK.Step 2: Inject the Universal Windows Plain Text Preview GUIDWindows uses a specific, master identity number (GUID) to run plain-text rendering. Adding this directly to the .mpl path forces the system shell to load it instantly.While still inside the HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.mpl folder in the Registry Editor, right-click an empty space in the right panel.Choose New > String Value.Name this new entry exactly: PerceivedType.Double-click PerceivedType and set its Value Data to exactly: textNext, create a brand-new subfolder key under .mpl:Right-click the .mpl folder icon on the left sidebar.Choose New > Key.Name this new key folder exactly: PersistentHandlerClick your new PersistentHandler folder on the left.On the right panel, double-click the (Default) string.Change its Value Data to the official Windows plain-text handler ID exactly:{5e941d80-bf96-11cd-b579-08002b30bf1e}Click OK and close the Registry Editor window.Step 3: Clear the Corrupted Explorer App CacheSince your user profile was returning a deletion error, you must clear out the lingering file association state from your temporary system processes.Press the Windows Key, type cmd, right-click Command Prompt, and select Run as administrator.Copy and paste this command block to terminate and instantly refresh your visual interface process tree:cmdtaskkill /f /im explorer.exe && start explorer.exe
Use code with caution.Your screen taskbar will disappear for a fraction of a second and come right back online.Open your original D:\User Account Ronan\Documents\MAPLE workspace directory and highlight a .mpl file. Because it is now structurally chained to the standard txtfile architecture, Windows will natively parse and display your plain-text code strings inside the Preview Pane with full scrolling support.Let me know if your code files load up cleanly now!AI responses may include mistakes. [Learn more](https://www.google.com/url?sa=i&source=web&rct=j&url=https://support.google.com/websearch?p%3Daimode&ved=2ahUKEwjB26CVhNyVAxVeU0EAHa9fExgQx6APegkIAggBCJMGEAE&opi=89978449&cd&psig=AOvVaw39JiLtTwQnSmnWxKOHNl3x&ust=1784457451245000)6 sitesWhy is Windows 10 Explorer preview pane not showing regular TXT files?If your Windows 10 Explorer preview pane isn't showing regular TXT files, you can try modifying the registry: 1. Hold down the Win...Super UserPreview File Types as Text in Preview Pane in Windows ...Setting the preview pane to view a filetype as text is as simple as setting a couple of registry keys. The average user really sho...timothytocci.comPreview Pane in File Explorer Not Working – Need HelpHello Jarred. I believe the issue might be related to missing or misconfigured preview handlers in your system. Since the Preview ...Microsoft LearnShow allYou said: not workingnot working21:21Because Windows has deeply locked down the .mpl file properties in your local profile database, it is completely ignoring the plain-text associations we created.Instead of continuing to battle the broken Windows registry, we can bypass the system's block by using a Windows Symbolic Extension Link. This forces File Explorer to stream your original .mpl files straight into the preview pane under a native .txt label that Windows already trusts, creating a seamless view with zero file duplication.Apply the Instant Mirror Link ConfigurationWe will add a quick "mirror" instruction to your active PowerShell script. When you hit save on a .mpl text file, the script instantly points a symbolic pointer link right to it using a .txt filename extension.Open your maple_autopdf.ps[1](https://superuser.com/questions/1224289/why-is-windows-10-explorer-preview-pane-not-showing-regular-txt-files) script file in Notepad, erase everything, and replace it with this final, unblocked code layout:powershell# --- CONFIGURATION ---
$WatchFolder = "D:\User Account Ronan\Documents\MAPLE"
# ---------------------

Clear-Host
Write-Host ">>> Maple & VS Code Custom Preview Engine Active <<<" -ForegroundColor Green
Write-Host "Monitoring Workspace Tree for .mw and .mpl: $WatchFolder" -ForegroundColor Cyan

while ($true) {
try {
# Scan for both Maple worksheets (.mw) and plain text source files (.mpl)
$RecentFiles = Get-ChildItem -LiteralPath $WatchFolder -Include "*.mw", "*.mpl" -Recurse | Where-Object { $_.LastWriteTime -gt (Get-Date).AddSeconds(-4) }

foreach ($File in $RecentFiles) {
$Path = $File.FullName

# --- CONDITION 1: IF IT IS A MAPLE WORKSHEET (.mw) ---
if ($File.Extension -eq ".mw") {
$SnapshotPath = $Path -replace "\.mw$", ".rtf"

Write-Host "Compiling structural syntax mapping for: $($File.Name)..." -ForegroundColor Yellow
Start-Sleep -Seconds 1

$RawText = Get-Content -LiteralPath $Path -Raw
$NoTagsText = $RawText -replace '<[^>]*>', "`r`n"
$DecodedText = $NoTagsText -replace '>', '>' -replace '<', '<' -replace '&', '&' -replace '"', '"'

$Lines = $DecodedText -split "`r`n"
$CleanLines = @()

foreach ($Line in $Lines) {
$Trimmed = $Line.Trim()
if (-not [string]::IsNullOrWhiteSpace($Trimmed) -and $Trimmed.Length -gt 1) {
if ($Trimmed -match 'restart|with|Matrix|Vector|factor|numer|denom|gcd|lcm|simplify|proc|local|option|if|then|else|elif|end|print|ERROR' -or $Trimmed -match ':=') {
if ($Trimmed.Length -gt 40 -and $Trimmed -notmatch '\s' -and $Trimmed -notmatch ':=') { continue }
if ($Trimmed.Length -gt 60) {
$Expanded = $Trimmed -replace ';', ";`r`n" -replace ' then ', " then`r`n" -replace ' else ', "`r`nelse`r`n" -replace ' elif ', "`r`nelif " -replace 'end if', "`r`nend if" -replace 'end proc', "`r`nend proc"
$SubLines = $Expanded -split "`r`n"
foreach ($SubLine in $SubLines) { if (-not [string]::IsNullOrWhiteSpace($SubLine.Trim())) { $CleanLines += $SubLine.Trim() } }
} else { $CleanLines += $Trimmed }
}
}
}

$RtfContent = "{\rtf1\ansi\deff0{\fonttbl{\f0\fswiss\fcharset0 Segoe UI;}{\f1\fmodern\fcharset0 Consolas;}}{\colortbl ;\red183\green[2](https://support.microsoft.com/en-us/topic/file-explorer-automatically-disables-the-preview-feature-for-files-downloaded-from-the-internet-56d55920-6187-4aae-a4f6-102454ef61fb)8\blue28;\red0\green96\blue175;}\f0\fs24\b\cf1 MAPLE WORKSHEET VISUAL SNAPSHOT\b0\cf0\par\fs18\i File: $($File.Name)\i0\par\line\fs20\b Active Math Commands & Procedures:\b0\par\line"
foreach ($Line in $CleanLines) { $Escaped = $Line -replace '\\', '\\\\' -replace '{', '\{' -replace '}', '\}'; $RtfContent += "\f[1](https://timothytocci.com/2017/06/23/preview-file-types-as-text-in-preview-pane-in-windows-explorer-on-windows-10-8-7-and-vista/)\fs22\cf2 $Escaped \cf0\f0\par" }
$RtfContent += "}"
$RtfContent | Out-File -LiteralPath $SnapshotPath -Encoding ascii -Force
Write-Host "Snapshot layout map updated!" -ForegroundColor Green
}

# --- CONDITION 2: IF IT IS A PLAIN TEXT SOURCE FILE (.mpl) ---
elseif ($File.Extension -eq ".mpl") {
# Create a matching path name ending in .txt
$MirrorTxtPath = $Path -replace "\.mpl$", ".txt"

if (-not (Test-Path -LiteralPath $MirrorTxtPath)) {
Write-Host "Creating unblocked shell preview channel for: $($File.Name)..." -ForegroundColor Cyan
# Inject a native symbolic file link that points Windows to the original source code
New-Item -ItemType HardLink -LiteralPath $MirrorTxtPath -Target $Path -Force | Out-Null
} else {
# If it already exists, touch it to force the Windows preview cache frame to refresh
(Get-Item -LiteralPath $MirrorTxtPath).LastWriteTime = Get-Date
}
Write-Host "Source text mirror synchronized!" -ForegroundColor Green
}
}
}
catch {
# Handle busy locks quietly
}

Start-Sleep -Seconds 3
}
Use code with caution.Save and Live Test Your WorkspaceSave the script edits inside Notepad.Launch your script in your open administrator PowerShell window.Open any .mpl file in Visual Studio, make a small change (like adding a space character), and click Save.Look at your folder. A .txt file with the exact same name will appear right next to it. Because it is a hardlink pointer, it occupies zero extra space on your hard drive, but clicking on it allows your PowerToys Preview Pane to natively display your original .mpl source code with full scrolling and lines.Let me know if this link mapping successfully loads your source text files onto the panel!AI responses may include mistakes. Learn more

Contributor guide

Open the contributing guide

Research direction

No implementation files or tests are named. Start by locating the PowerToys component responsible for Windows Explorer preview handling and compare how .json files are supported; done means .mpl files can be previewed in Explorer, with the supported extension behavior defined clearly.

Written by the indexing model from the issue text.

Assessment

Domain
desktop, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.