Page 1 of 1

Pass file to Preview

Posted: 02 Apr 2026 18:37
by Native2904
Hello,

I wanted to ask if it’s possible to call the XY preview from the outside via command line?

Something like this:

Code: Select all

xyplorer.exe /preview
I have a batch file that generates a spectrogram for each of the same two songs from different sources with FFmpeg and then compares them with WinMerge… I really like WinMerge, but for a quick overview it’s too powerful. So I changed the script to place the two images vertically on top of each other and then open them, so I can quickly see which source has the better quality.

I use IrfanView for that, which is also great, but the XY preview can images "zoom2cursor", and I find this effect the fastest and most comfortable way for a quick comparison.

Code: Select all

set "irfanview=C:\Users\Home\Apps\IrfanView\i_view64.exe"
Is it possible to open this image with XYplorer’s preview?
I couldn’t find anything about it in the help at first glance.

Thank you in advance.

Re: Pass file to Quickview

Posted: 02 Apr 2026 19:28
by highend
Quickview = Quick File View?

Run it with a script:

Code: Select all

focus 'L'; sendkeys ' '; wait 100; #177;

Re: Pass file to Preview

Posted: 02 Apr 2026 20:33
by Native2904
Not Quick File View but Preview.

Sorry if I’m asking stupid questions out of impatience… but you can’t just mix two different syntaxes, right? How am I supposed to integrate that command into my batch file?

Code: Select all

@echo off
setlocal enabledelayedexpansion

set "file1=%~1"
set "file2=%~2"

set "out1=%TEMP%\spec1.png"
set "out2=%TEMP%\spec2.png"
set "final=%TEMP%\comparison.png"

set "ffmpeg=C:\Youtube\ffmpeg.exe"
set "xypreview=C:\XYplorer\XYplorer.exe /focus 'L'; sendkeys ' '; wait 100; #178;"
set "font=C:\Windows/Fonts/arial.ttf"

echo file1=%file1%
echo file2=%file2%
pause

set "name1=%~nx1"
set "name2=%~nx2"

REM Bild 1
"%ffmpeg%" -y -i "%file1%" ^
-filter_complex "[0:a]aformat=channel_layouts=mono,showspectrumpic=s=2048x800:legend=1:scale=log,drawtext=fontfile='%font%':text='%name1%':x=10:y=10:fontsize=24:fontcolor=white" ^
-frames:v 1 "%out1%"

REM Bild 2
"%ffmpeg%" -y -i "%file2%" ^
-filter_complex "[0:a]aformat=channel_layouts=mono,showspectrumpic=s=2048x800:legend=1:scale=log,drawtext=fontfile='%font%':text='%name2%':x=10:y=10:fontsize=24:fontcolor=white" ^
-frames:v 1 "%out2%"

REM Bilder stapeln
"%ffmpeg%" -y -i "!out1!" -i "!out2!" ^
-filter_complex "[0:v][1:v]vstack=inputs=2" ^
-frames:v 1 -update 1 "!final!"

REM Anzeigen
"%xypreview%" "!final!"

Re: Pass file to Preview

Posted: 02 Apr 2026 22:53
by jupe
If you change %xypreview% to just the XY exe path, and then your last line to this:

"%xypreview%" /feed="::goto '!final!'; if (!<get #178>) { #178; }"

I think it should do what you require, but it is just aircode

Re: Pass file to Preview

Posted: 02 Apr 2026 23:48
by Native2904
thank you you for your script!
but unfortunately it doesn't run..

Re: Pass file to Preview

Posted: 03 Apr 2026 00:12
by jupe
Ah I just realized a possible issue when running from a bat, try the last line like this instead:

"%xypreview%" /feed="::goto '!final!'; if (<get #178> == 0) { #178; }"

Re: Pass file to Preview

Posted: 03 Apr 2026 08:56
by Native2904
yes :mrgreen: it runs fantastic...thank you many times 2jupe!

I think the image preview in XYplorer has so much more to offer than QuickLook or Seer... it’s a real hidden gem. (Just my personal opinion)