Yes, that appears to do the trick. Here's a little test program that accepts a number of bytes of the command line for testing. I hardcoded the file name and directory. You can change them if you like for testing:
@echo off
setlocal
echo Checking File Size
set fileSize=200
if not "%~1"=="" set fileSize=%~1
set dirName=\temp\temp\temp
set fileName=temp.dat
REM %TEMP%\chmbuild
REM htmlhelp.chm
pushd.
cd /D "%dirName%"
set error=
for /f "delims=" %%a in ('dir /b "%fileName%" 2^>NUL') do if /I %%~za LSS %fileSize% set error=Y
popd
if "%error%"=="Y" goto :ERROR
echo No error...
goto :EOF
:ERROR
echo Error
Main Topics
Browse All Topics





by: SteveGTRPosted on 2006-05-03 at 13:34:35ID: 16600101
A quick glance and I'd say you should do the following:
echo Checking File Size
pushd.
cd /D "%TEMP%\chmbuild"
set error=
for /f "delims=" %%a in ('dir /b htmlhelp.chm 2^>NUL') do if /I %%~za LSS 2000000 set error=Y
popd
if "%error%"=="Y" goto :ERROR
I'll run some more tests.
Good Luck,
Steve