02-07-2009, 04:32 PM
So I was sick and bored. I noticed compiling adds revision tag novadays to filename. Very cool but I usually like to launch latest revision from shortcut. So I decided to make small launcher that automatically selects latest pcsx2-rxxx.exe. It falls back to pcsx2.exe if no -rxxx tagged files is found and it doesn't launch anything if there is no pcsx2*.exe files.
it should skip develop/debug versions at the moment as delimiter is set to "2-r". So it will skip files like pcsx2vm-r, pcsx2d-rxxx and so on.
I'm pretty sure it won't work with win7 atm as it needs ~dp0 or something to paths. I might fix it later when I boot my win7.
Anyways. feel free to use it if you wan't. I know there are lazy people like me who can't be bothered to rename their files or re-direct their shortcuts all the time.
create new text file and copy following inside it. Rename it to launcher.bat (or filenameYouWant.bat). Run.
launcher.bat v1.0
Last but not least. I can't find any reason why this small batch could harm someones pc. Only app it runs is pcsx2.exe it finds.
STILL. Use at your own risk. I'm not taking responsibility if something explodes.
it should skip develop/debug versions at the moment as delimiter is set to "2-r". So it will skip files like pcsx2vm-r, pcsx2d-rxxx and so on.
I'm pretty sure it won't work with win7 atm as it needs ~dp0 or something to paths. I might fix it later when I boot my win7.
Anyways. feel free to use it if you wan't. I know there are lazy people like me who can't be bothered to rename their files or re-direct their shortcuts all the time.
create new text file and copy following inside it. Rename it to launcher.bat (or filenameYouWant.bat). Run.
launcher.bat v1.0
Code:
@echo off
SetLocal EnableDelayedExpansion
SET LargestValue=0
SET file=pcsx2.exe
for /f "tokens=*" %%G in ('dir /b pcsx2*.exe') do (
set filename=%%G
call :PARSE
)
IF EXIST !file! start !file!
GoTo :EOF
:PARSE
for /f "tokens=2 delims=2-r;." %%L in ("!filename!") do (
IF /I !LargestValue! LSS %%L (
SET LargestValue=%%L
SET file=!filename!
)
)
:EOF
Endlocal
Last but not least. I can't find any reason why this small batch could harm someones pc. Only app it runs is pcsx2.exe it finds.
STILL. Use at your own risk. I'm not taking responsibility if something explodes.