I 'm currently writing a batch-file to execute an unknown named checksum file in a directory. The problem is that I have no idea how to search for an .sfv
or .md5
in a directory and set the found checksum file as a variable which I can execute later on in the script.
@echo off
set quicksfv="%ProgramFiles%\QuickSFV\quicksfv.exe"
if exist "*.sfv" (
goto sfvcheck
)
and (
set EXT="sfv"
)
else (
goto skip
)
if exist "*.md5" (
goto sfvcheck
)
and (
set EXT="md5"
)
else (
goto skip
)
/*
this is what i would like to add if the checksum file exist
*/
GetFileName of checksum file
set CHECKSUM="checksumfilename"
:sfvcheck
quicksfv "%CHECKSUM%.%EXT%"
:skip
echo. No checksum file was found!
pause
exit