Recent Posts

Pages: [1] 2 3 4 5 ... 10
1
Gemini 3.5 Flash AI generated::
The intermittent "works on the second try" bug you are experiencing is a classic symptom of how Windows handles process creation and Shell communication, specifically when using `cmd.exe` as an unnecessary middleman.

Here is the refactored, robust version of your MultiScript. Below it is a breakdown of exactly why your original script was misbehaving.

### The Robust MultiScript (Replace `"C:\\Path\\To\\syspin.exe"` with the actual full path to your `syspin.exe`. Do the same and modify the code to extend support across all remaining operational modes):
Code: [Select]
```MultiScript
@var $filePath = GetSourceFocusPath();
@var $syspin = "C:\\Path\\To\\syspin.exe"; // Ensure double backslashes

// 1. Sanity Check: Prevent execution if no file is focused
if ( $filePath == "" ) {
    return;
}

// 2. Format arguments cleanly without the cmd.exe syntax
@var $args = "\"" + $filePath + "\" 5386";

// 3. Direct Execution: Bypass cmd.exe completely
MC.Run CMD="{$syspin}" ARG="{$args}";
```

Here are the rest of the codes:
+--------------------------------------------------------------+
| Action                     | Code   | Description                 |
+----------------------------|--------|------------------------------+
| Pin to taskbar             | 5386   | Pin the file to taskbar     |
| Unpin from taskbar         | 5387   | Remove from taskbar        |
| Pin to Start               | 51201  | Pin to Start menu          |
| Unpin from Start           | 51394  | Remove from Start menu     |
+--------------------------------------------------------------+

### What was causing the bug? (Under the Hood)

Your original script was doing this:
`MC.Run CMD="cmd.exe" ARG="/C \"\"C:\syspin.exe\" \"C:\file.txt\" 5386\"";`

There are two low-level mechanisms at play here that cause this to fail intermittently, requiring a second attempt.

#### 1. The `cmd.exe` Quoting Trap

When you invoke `cmd.exe` with the `/C` (terminate after execution) flag, you pass the command string into a notoriously complex parser. If the first and last characters of the argument string are quote marks, `cmd.exe` attempts to apply a heuristic to decide whether to strip them.

Depending on whether `$syspin` or `$filePath` contained spaces, `cmd.exe` might strip the outer quotes but fail to properly tokenize the inner ones. This often results in a malformed path being passed to the system, causing `cmd.exe` to quietly abort the operation without an error message. On the second click, the environment state or memory caching might shift just enough for the command to parse, or Explorer "catches up."

#### 2. Win32 Shell COM Interruption (The Real Culprit)

SysPin works by tapping into the Windows Shell API. It does not literally edit your taskbar registry keys; instead, it programmatically invokes an `IShellDispatch` Context Menu Verb (specifically the verb internally mapped to the ID `5386`).

This relies on COM (Component Object Model) Inter-Process Communication (IPC) to send a message to `explorer.exe`.

When you wrap SysPin inside `cmd.exe /C`, you are creating a transient parent process.

1. MultiCommander spawns `cmd.exe`.
2. `cmd.exe` spawns `syspin.exe`.
3. `syspin.exe` sends the COM request to `explorer.exe` to pin the item.
4. `cmd.exe` sees `syspin.exe` executing and often immediately begins its own tear-down process because of the `/C` flag.

If the console subsystem tears down the process tree *before* `explorer.exe` has fully finished handling the COM message across process boundaries, the taskbar pin operation is abruptly dropped. The first attempt "wakes up" the shell verb handler in Explorer, and the second attempt succeeds because the handler is now cached and responds fast enough to beat the `cmd.exe` shutdown window.

### The Fix

By changing `MC.Run` to target `syspin.exe` directly, you bypass the command interpreter entirely. MultiCommander uses standard Win32 `CreateProcess` to launch SysPin in its own stable, independent process space. SysPin can now cleanly send its COM message to the Windows Shell, wait for the acknowledgment, and exit gracefully without an artificial `cmd.exe` wrapper pulling the rug out from under it.
2
This is a follow-up. The previous scripts had compatibility issues with older Win 95+ OS's-based Screensavers etc. (they wouldn't detect the Wallpaper like in the BLOCKS/ Windows 98.SCR screensaver)

Legacy Windows 98 Screensaver Compatibility Fix via PowerShell
The issue stems from two primary compatibility gaps between modern Windows 10 and legacy Win32/16 architecture:

  • Image Format Limitation: Legacy screensavers (e.g., Windows 98.SCR) lack JPEG/PNG decoding capabilities and rely solely on uncompressed BMP files for textures.
  • Registry Synchronization: Modern Windows 10 manages wallpaper transcoding internally, often failing to update legacy registry keys (HKCU:\Control Panel\Desktop\Wallpaper) with raw image paths, causing detection failures.

Solution Overview:
  • On-the-fly BMP Conversion: The script leverages .NET's System.Drawing to transcode any user-selected image (JPG, PNG, WebP) into a 24-bit BMP, ensuring compatibility.
  • Reliable Storage Path: Saves the BMP to a predictable, short path (e.g., $env:USERPROFILE\classic_wallpaper.bmp) to facilitate detection by legacy screensavers.
  • Registry & API Updates: Manually updates the Wallpaper registry key with the BMP path and invokes SystemParametersInfo API with SPI_SETDESKWALLPAPER to immediately apply, ensuring the screensaver detects the correct wallpaper image.

You need five of these scripts for each of the modes (replace the code lines of each according to the following):
+--------------------------------------------------------+
|                Style Reference Map                     |
+------------------------------+-------------------------+
| Style                        | Registry Settings      |
+------------------------------+-------------------------+
| Stretch                      | WallpaperStyle='2'      |
|                              | TileWallpaper='0'       |
+------------------------------+-------------------------+
| Fit                          | WallpaperStyle='6'      |
|                              | TileWallpaper='0'       |
+------------------------------+-------------------------+
| Fill                         | WallpaperStyle='10'     |
|                              | TileWallpaper='0'       |
+------------------------------+-------------------------+
| Center                       | WallpaperStyle='0'      |
|                              | TileWallpaper='0'       |
+------------------------------+-------------------------+
| Tile                         | WallpaperStyle='0'      |
|                              | TileWallpaper='1'       |
+------------------------------+-------------------------+
| Span                         | WallpaperStyle='22'     |
|                              | TileWallpaper='0'       |
+------------------------------+-------------------------+

1. Here's the full script for 'Stretched', change the two values and repeat for the rest of the scripts modes (Gemini 3.5 Flash AI Generated):
Code: [Select]
```SetWallpaperMCStretch.ps1
param([string]$ImagePath)

# Validate file exists
if (-not (Test-Path $ImagePath)) {
    Write-Error "File not found: $ImagePath"
    exit 1
}

# Load .NET Assembly for Image Processing
Add-Type -AssemblyName System.Drawing

# Define a clean, static path for the legacy BMP file
# Legacy screensavers handle paths without spaces much better
$BmpPath = "$env:USERPROFILE\classic_wallpaper.bmp"

# Convert the source image to a 24-bit BMP to satisfy the Win98 screensaver engine
try {
    $SrcImage = [System.Drawing.Image]::FromFile($ImagePath)
   
    # If a previous wallpaper BMP exists, delete it first to release file locks
    if (Test-Path $BmpPath) {
        Remove-Item $BmpPath -Force -ErrorAction SilentlyContinue
    }
   
    # Save as BMP format
    $SrcImage.Save($BmpPath, [System.Drawing.Imaging.ImageFormat]::Bmp)
    $SrcImage.Dispose()
}
catch {
    Write-Error "Failed to process and convert image: $_"
    exit 1
}

# Set style: Stretch (Style '2', Tile '0')
Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name WallpaperStyle -Value '2'
Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name TileWallpaper -Value '0'

# FORCE legacy wallpaper path update in the registry for the screensaver
Set-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name Wallpaper -Value $BmpPath

# Apply wallpaper via Win32 API
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
public class Wallpaper {
    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    public static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
}
"@ -ErrorAction SilentlyContinue

# SPI_SETDESKWALLPAPER = 0x0014 (20)
# SPIF_UPDATEINIFILE | SPIF_SENDCHANGE = 3
[Wallpaper]::SystemParametersInfo(20, 0, $BmpPath, 3)
```


2. Plus interface it in MC 'User-Defined Command' script like this (replace the FilePath in the script with your local path (ensure directory separators are escaped with double backslashes \\).):
Code: [Select]
```MultiScript
@var $imgPath = GetSourceFocusPath();
@var $arguments = "-ExecutionPolicy Bypass -File \"C:\\Path\\To\\SetWallpaperMCStretch.ps1\" -ImagePath \"" + $imgPath + "\"";
MC.Run CMD="cmd.exe /c powershell.exe" ARG="{$arguments}";
```

Notes:
Tested on MC 16.0 running on Windows 10.
To add to the context menu: navigate to Config > "Custom Context Menu" and add the script.

Technical Highlights:
  • Uses PowerShell + .NET for image transcoding.
  • Sets appropriate registry values (WallpaperStyle and TileWallpaper) for correct display behavior.
  • Invokes Win32 API call for immediate wallpaper refresh.
  • Ensures backward compatibility for Win95/98-style screensavers expecting BMP textures and registry cues.
3
Beta Releases / Re: v16.0 Beta
« Last post by Mathias (Author) on May 22, 2026, 17:30:06 »
Quote

I can't reproduce that.   The column thing might be fixed with the other column issues that was fixed.. but the miscalculation of items I can't reproduce.

Thanks for fixing the column thing ;)
I am still having the queue weirdness but I suspect that the fact I'm using a custom commmand & the NODIALOG option may be related as F6 has behaved better.
See attached CC dialog entry.
So what is happening ? items not added to queue at all ?  What is the situation. lots of large /small files.. and you add to existing when there is allready a file operation in process... so it is not added to queue ? or something else.. ?
4
Beta Releases / Re: v16.0 Beta
« Last post by Ulfhednar on May 22, 2026, 15:18:53 »
Quote

I can't reproduce that.   The column thing might be fixed with the other column issues that was fixed.. but the miscalculation of items I can't reproduce.

Thanks for fixing the column thing ;)
I am still having the queue weirdness but I suspect that the fact I'm using a custom commmand & the NODIALOG option may be related as F6 has behaved better.
See attached CC dialog entry.
5
Support and Feedback / Re: Lost menu bar
« Last post by Mathias (Author) on May 21, 2026, 11:05:39 »
Ctrl+M
6
Support and Feedback / Lost menu bar
« Last post by imadube on May 21, 2026, 10:30:14 »
I somehow lost my Menu Bar.
Anyone can help me get it turned back on?
7
Support and Feedback / Re: Quick filter
« Last post by total_annihilation00 on May 14, 2026, 09:31:42 »
Thanks, I'm trying claude at the moment. I will try to create an empty filter to quickly clear the filter.

Alright good luck 👍, but I had a bad experience with Claude's free-tier 'Sonnet', unless you're using 'Claude Opus 4.7 Thinking' (paid model), it's pretty useless. Whereas ChatGPT is amazingly good even with their free-tier models (just make sure you enable 'Thinking Mode')!
8
Support and Feedback / Re: Quick filter
« Last post by mgigli on May 14, 2026, 02:11:07 »
Thanks, I'm trying claude at the moment. I will try to create an empty filter to quickly clear the filter.
9
Beta Releases / Re: v16.0 Beta
« Last post by Matthias515566 on May 13, 2026, 13:58:39 »
The error when moving files that also exist in the destination folder in protected directories when MC was started in admin mode has apparently been fixed. Thank you.
10
Beta Releases / Re: v16.0 Beta
« Last post by total_annihilation00 on May 11, 2026, 17:26:19 »
Its probably a bug, But If I can't reproduce it. I can't fix it.  And unfortunately, I haven't been able to replicate this behavior. Because my development time is limited, I have to prioritize bugs with clear reproduction steps.
I'll keep this issue open in case others can provide more details or specific steps to help me trigger the issue.

I fixed it, the bug is due to me accidentally pressing Enter in "AutoLoad on Path" while entering the recursive paths in "Column Layouts" dialog. It's causing possible corruption of the dialog/ form.
No I spoke too soon ("My Advanced Tweaks" layout is still broken, but I got "Default" layout to work.) 8) O.K. I can confirm the problem lies in making a new "Column Layout". If I stick to the "Default" column layout it works, maybe a new Column Layout with "AutoLoad on Path" is causing issues...
Default Layout, when importing from other custom layouts, shows a message box with Chinese characters, so there is some corruption since custom layout allows "AutoLoad on Path" and Default layout does not allow this. I hope I made this clear...
Pages: [1] 2 3 4 5 ... 10