XP HE SP3 ITA
Problem: the scripting command run fails to pass properly parameters containing parenthesis.
The following codes basically take an image via drag and drop to convert it in bmp. The final batch file can take two parameters, an image file path and a number ranging from 1 to 4. There's some smartness coded inside. These codes fail when the image contains parenthesis in the filename, i.e. the DOS window simply flashes on screen and no file output is produced. Spaces in filename don't cause the problem. I already debugged, as far as I can, the batch file and the XY scripts, and can't find code flaws explaining the behaviour. The bug supposed in the title is my best guess.
This script in the Catalog
Code: Select all
"1|<xypath>\..\Dexpot\Hintergrund Personalizzato 1.bmp"
load "Desktop";
"2|<xypath>\..\Dexpot\Hintergrund Personalizzato 2.bmp"
load "Desktop";
"3|<xypath>\..\Dexpot\Hintergrund Personalizzato 3.bmp"
load "Desktop";
"4|<xypath>\..\Dexpot\Hintergrund Personalizzato 4.bmp"
load "Desktop";Code: Select all
$sfo=<get drop>;
if ($sfo != "") {
$sfo=quote($sfo);
}
$num=self("caption");
run "<xypath>\..\CLI\NConvert - Desktop.bat" $sfo $num;Code: Select all
@echo off
color 5f
title %~n0
cd /d "%~dp0"
if not [%1]==[] (
echo %1 | find /i ":\" > nul
if not errorlevel 1 (
set "sfo=%1"
) else (
set "num=%1"
)
)
if not [%2]==[] (
if defined sfo (
set "num=%2"
) else (
set "sfo=%2"
)
)
:sfondo
if not defined sfo set /p sfo="Sfondo del desktop: "
if exist %sfo% goto numero
set "sfo="
echo Sfondo inesistente.
echo Inserire uno sfondo valido nel prompt sottostante.
echo.
goto sfondo
:numero
if not defined num set /p num="Numero del desktop: "
if %num%==1 goto conversione
if %num%==2 goto conversione
if %num%==3 goto conversione
if %num%==4 goto conversione
set "num="
echo Numero non valido.
echo Inserire un numero valido nel prompt sottostante.
echo.
goto numero
:conversione
nconvert -overwrite -quiet -out bmp -o "..\Dexpot\Hintergrund Personalizzato %num%" %sfo%
XYplorer Beta Club