79362706

Date: 2025-01-16 18:29:36
Score: 0.5
Natty:
Report link

You should use a combination of dir with the /B flag and findstr

@echo off
setlocal enabledelayedexpansion

set "zipMask=ZipForCloudMaster ????-??-??_??-??-??.zip"
set "zcnt=0"

REM Use dir and pipe through findstr to handle the specific pattern
for /f "delims=" %%A in ('dir /b /a-d ^| findstr /r /i "^ZipForCloudMaster [0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]_[0-9][0-9]-[0-9][0-9]-[0-9][0-9]\.zip$"') do (
    if !zcnt!==0 echo Zip files present:
    echo %%A
    set /a zcnt+=1
)

if !zcnt!==0 (
    echo WARNING: Older zip files found. Proceeding will include these in the new zip.
) else (
    echo No older zip files found. Safe to proceed.
)
Reasons:
  • Blacklisted phrase (1): ???
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Swapnil Prakash