bug in del_old_driverpacks.bat
› Forums › Snappy Driver Installer Origin › bug in del_old_driverpacks.bat
Tagged: SDIO
- This topic has 4 replies, 3 voices, and was last updated 10 months ago by
Pier B.
-
AuthorPosts
-
-
27 April, 2022 at 4:07 pm #5200
The driverpack cleanup batch file wrongfully attempts to delete DP_Sounds_Realtek_22035.7z, even though this driverpack is up to date (included in the latest driverpack torrent.)
I’m no expert, but it looks like it’s confusing DP_Sounds_Realtek_DCH_22043.7z as a newer version when the DCH and non-DCH should be seen as separate and unrelated packs.
-
27 April, 2022 at 9:25 pm #5201
You are totally correct and thanks for bringing that to my attention. The DCH file is new this release and I missed it. I’ve updated the batch file to better support the new variation.
Here’s the new version (watch out for extraneous code tags, they are the backticks):
MS DOS12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455@echo offecho Snappy Driver Installer Originecho Driver Pack Cleanupecho by Computer Blokeecho.@setlocal enableextensions@cd /d "%~dp0/drivers"attrib *.* -Rrem out of date driver packsfor /f "tokens=1,2,3,4,5,6,7 delims=_. usebackq" %%i in (<code>dir /b *.7z</code>) do call :cleanup %%i %%j %%k %%l %%m %%n %%orem redundant driver packsdel DP_Sound_ADI_*.7z 2> nulcd ..goto :end:cleanupif /i "%7"=="7z" call :clean7 %1 %2 %3 %4 %5 %6 && goto :eofif /i "%6"=="7z" call :clean6 %1 %2 %3 %4 %5 && goto :eofif /i "%5"=="7z" call :clean5 %1 %2 %3 %4 && goto :eofif /i "%4"=="7z" call :clean4 %1 %2 %3 && goto :eofif /i "%3"=="7z" call :clean3 %1 %2 && goto :eofgoto :eof:clean7for /f "tokens=* usebackq" %%f in (<code>dir /b /on "%1_%2_%3_%4_%5_?????.7z"</code>) do set "GOODFILE=%%f"echo Keeping most recent driver file: %GOODFILE%for %%f in (%1_%2_%3_%4_%5_?????.7z) do if not "%%f"=="%GOODFILE%" echo "%%f" & del "%%f"goto :eof:clean6for /f "tokens=* usebackq" %%f in (<code>dir /b /on "%1_%2_%3_%4_?????.7z"</code>) do set "GOODFILE=%%f"echo Keeping most recent driver file: %GOODFILE%for %%f in (%1_%2_%3_%4_?????.7z) do if not "%%f"=="%GOODFILE%" echo "%%f" & del "%%f"goto :eof:clean5for /f "tokens=* usebackq" %%f in (<code>dir /b /on "%1_%2_%3_?????.7z"</code>) do set "GOODFILE=%%f"echo Keeping most recent driver file: %GOODFILE%for %%f in (%1_%2_%3_?????.7z) do if not "%%f"=="%GOODFILE%" echo "%%f" & del "%%f"goto :eof:clean4for /f "tokens=* usebackq" %%f in (<code>dir /b /on "%1_%2_?????.7z"</code>) do set "GOODFILE=%%f"echo Keeping most recent driver file: %GOODFILE%for %%f in (%1_%2_?????.7z) do if not "%%f"=="%GOODFILE%" echo "%%f" & del "%%f"goto :eof:clean3for /f "tokens=* usebackq" %%f in (<code>dir /b /on "%1_?????.7z"</code>) do set "GOODFILE=%%f"echo Keeping most recent driver file: %GOODFILE%for %%f in (%1_?????.7z) do if not "%%f"=="%GOODFILE%" echo "%%f" & del "%%f"goto :eof:end-
This reply was modified 1 year ago by
Glenn.
-
This reply was modified 1 year ago by
Glenn.
-
This reply was modified 1 year ago by
Glenn.
-
This reply was modified 1 year ago by
-
30 April, 2022 at 1:05 pm #5208
Thank You!
-
26 January, 2023 at 8:00 am #5745
I use such a file DelOldDP.bat found on the web and everything works, even with the latest packs from Samlab
123456789101112131415161718192021222324252627282930313233343536@echo offsetlocal enableextensionsfor %%a in ("%~dp0drivers\DP_*.7z") do call :ProcessDP "%%~na"goto :eof:ProcessDPcall :GetPrefSuff %1if "%Pref%"=="" goto :eofif "%Suff%"=="" goto :eoffor %%b in ("%~dp0drivers\%Pref%*.7z") do call :DelIfOld "%%~nb" "%Pref%" "%Suff%"goto :eof:DelIfOldcall :GetPrefSuff %1if "%Pref%"=="" goto :eofif "%Suff%"=="" goto :eofif %~3 LEQ %Suff% goto :eofecho Deleting old DP - "%Pref%%Suff%.7z"del /f /q "%~dp0drivers\%Pref%%Suff%.7z"goto :eof:GetPrefSuffset Suff=set Pref=%~1call :PrefixRecgoto :eof:PrefixRecset LastCh=%Pref:~-1%if "%LastCh%"=="" goto :eofif "%LastCh%"=="_" goto :eofset Suff=%LastCh%%Suff%set Pref=%Pref:~0,-1%call :PrefixRecgoto :eof -
26 January, 2023 at 8:09 am #5746
-
-
AuthorPosts
- You must be logged in to reply to this topic.