i dont get this if im using the windows start command but keep te filename enclosed in """ it tries tor un any paramters as if it was file as well
e.g.
start Something.bat 2
execute probably and start smethng.bat with the parameter 2
start "Something.bat" 2
Windows message box pups up informing me windows couldt not find my file 2
this pretty much negates me form using start command on bat files with space in them.
and i used that in my png optimzing batch since i used bat files named after the input filt to avoid collision if multiple instances of my batch is executed
PNGbest.bat
Code:
@ECHO OFF
set strenght=%2
if "%2"=="" set strenght=15
if not "%2"=="" set /a RandIt=(%2/%NUMBER_OF_PROCESSORS%)
set /a TotalIt=%RandIt%"*%NUMBER_OF_PROCESSORS%
ECHO --- SvenBent's PNGbest is optimizing your PNG file
ECHO CPU threads: %NUMBER_OF_PROCESSORS%
ECHO Zopfli compression strenght: %strenght%
ECHO Random initial tables : %TotalIt%
If "%3"=="brutal" ECHO Extended brute force: Enabled (not supported)
ECHO File: %1
ECHO Size: %~z1
ECHO --- PNGwolf-Zopfli ---
pngwolf --in=%1 --out=%1 --zopfli-iterations=%strenght%
ECHO --- Finding optimal filter ---
for %%f in (6,0,1,2,3,4,5) do pngout %1 /f%%f
ECHO --- Block split threshold ---
for %%b in (64,96,128,192,384,512,768,1024,1536,2048,3072,4096,8192,16384,0) do pngout %1 /f6 /b%%b
ECHO --- Random initial tables and mixing blocks ---
if "%2"=="" goto norandom
echo for /l %%%%r in (1,1,%RandIt%) do ( >%1.pngmix.bat
echo pngout %1.thread.%%1.png %1.tmp.%%1.png /r /force /f6 /kp >>%1.pngmix.bat
echo Deflopt /b /s %1.tmp.%%1.png >>%1.pngmix.bat
echo huffmix %1.thread.%%1.png %1.tmp.%%1.png %1.thread.%%1.png >>%1.pngmix.bat
echo del %1.tmp.%%1.png >>%1.pngmix.bat
echo ) >>%1.pngmix.bat
echo del %1.%%1.tag >>%1.pngmix.bat
echo exit >>%1.pngmix.bat
for /l %%t in (1,1,%NUMBER_OF_PROCESSORS%) do (
Copy %1 %1.thread.%%t.png
echo tag > %1.%%t.tag
start %1.PNGmix.bat %%t
)
ECHO Waiting for threads to close
:keepwait
timeout 1 >nul
if exist %1.?.tag goto keepwait
if exist %1.??.tag goto keepwait
if exist %1.???.tag goto keepwait
if exist %1.????.tag goto keepwait
ECHO Final mixing stages
for /l %%t in (1,1,%NUMBER_OF_PROCESSORS%) do (
huffmix %1 %1.thread.%%t.png %1
del %1.thread.%%t.png
)
del %1.pngmix.bat
:norandom
ECHO --- Optmizing deflate structure ---
deflopt /b %1
defluff <%1 >%1.fluff.png
deflopt /b %1.fluff.png
huffmix %1 %1.fluff.png %1
deflopt /b %1
del %1.fluff.png
The bolded line is where i get troubles in my batch files however the behavior exist if i just type it manually in a command line box as well.
Windows 7 sp1 pro
Intel I5 2500k
16gb Kingston beast 2400mhz ram
Asrock P67 Extreme6 motherboard (bios 2.10)