From 425aeda883fd4888ea64112df78a666f7579d949 Mon Sep 17 00:00:00 2001 From: Michael Malloy Date: Fri, 12 Mar 2021 23:05:10 -0600 Subject: [PATCH 1/2] Remove exclamation points from file names --- Windows/WiiWarePatcher.bat | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/Windows/WiiWarePatcher.bat b/Windows/WiiWarePatcher.bat index 280eb67..fd0e7b7 100644 --- a/Windows/WiiWarePatcher.bat +++ b/Windows/WiiWarePatcher.bat @@ -1,7 +1,5 @@ @echo off -REM --- Important for file counter to work --- -setlocal ENABLEDELAYEDEXPANSION -rem --- + cd /d "%~dp0" set currentPath=%cd% goto begin @@ -59,6 +57,12 @@ set /a errorwinxp=0 set /a updateserver=1 goto choose_patch_type +rem This is called to remove exclamation points from file names. +rem Exclamation points break the script when ENABLEDELAYEDEXPANSION is set for the file counter. +:RemoveExclamationPoints +set "filename=%~n1" +ren %1 "%filename:!=%%~x1" +goto :EOF :begin_main if %aio_assisted%==1 exit @@ -790,11 +794,19 @@ if not exist temp md temp if not exist wiimmfi-wads md wiimmfi-wads if not exist backup-wads md backup-wads +rem Removes Exclamation Points for ENABLEDELAYEDEXPANSION +for %%r in ("*.wad") do call :RemoveExclamationPoints "%%r" + +rem --- Important for file counter to work --- +setlocal ENABLEDELAYEDEXPANSION +rem --- + for %%f in ("*.wad") do ( cls echo %header_loop% echo ------------------------------------------------------------------------------------------------------------------------------ echo. +echo %%~nf echo Patching file [!patching_file!] out of [%file_counter%] echo File name: %%~nf echo. From 64c2e1d1d266787234e2e45283688e79907d51bf Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 12 Mar 2021 23:06:19 -0600 Subject: [PATCH 2/2] Remove accidental echo --- Windows/WiiWarePatcher.bat | 1 - 1 file changed, 1 deletion(-) diff --git a/Windows/WiiWarePatcher.bat b/Windows/WiiWarePatcher.bat index fd0e7b7..26d2b42 100644 --- a/Windows/WiiWarePatcher.bat +++ b/Windows/WiiWarePatcher.bat @@ -806,7 +806,6 @@ cls echo %header_loop% echo ------------------------------------------------------------------------------------------------------------------------------ echo. -echo %%~nf echo Patching file [!patching_file!] out of [%file_counter%] echo File name: %%~nf echo.