I am currently faced with a problem, where I need to be able to launch another batch file if a file is under 10KB.
E.g. If xxxxx.txt is greater than 10KB launch stage2.bat
I am currently faced with a problem, where I need to be able to launch another batch file if a file is under 10KB.
E.g. If xxxxx.txt is greater than 10KB launch stage2.bat
This bat file checks whether the file size of xxxxx.txt is greater than 10KB (10280 bytes) and can assign some tasks depends on the result.
@echo off
cd C:\MyFolder\
set file="xxxxx.txt"
set maxbytesize=10280
FOR /F "usebackq" %%A IN ('%file%') DO set size=%%~zA
if %size% GTR %maxbytesize% (
//do stuff
) ELSE (
//do stuff
)