I do not see the moving message. I've tried replacing the if with an echo to see what size is reported. Will let you know.
Main Topics
Browse All TopicsThis is on Xp if it is relevant and is a continuation of my previous question. This script hits the error catch even with a file of 3,283,729 bytes:
@echo off
echo\
echo Changing Directory
cd /d %2
del %TEMP\chmbuild\*
CALL prepare_xml.bat %1 %2
CALL strip_remarks.bat %1 %2
echo Building Intermediate Files
xsltproc --xinclude --stringparam l10n.gentext.default.langu
if not %errorlevel%==0 goto :ERROR
echo Compiling HTML Help File
hhc.exe %TEMP%\chmbuild\htmlhelp.h
if not %errorlevel%==0 goto :ERROR
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
echo Moving from Temp Directory
move %TEMP%\chmbuild\htmlhelp.c
if not %errorlevel%==0 goto :ERROR
goto :EXIT
:ERROR
echo ERROR ENCOUNTERED
exit /B -1
:EXIT
exit /B 0
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
This script results in no size value echoed at all.
@echo off
echo\
echo Changing Directory
cd /d %2
del %TEMP\chmbuild\*
CALL prepare_xml.bat %1 %2
CALL strip_remarks.bat %1 %2
echo Building Intermediate Files
xsltproc --xinclude --stringparam l10n.gentext.default.langu
if not %errorlevel%==0 goto :ERROR
echo Compiling HTML Help File
hhc.exe %TEMP%\chmbuild\htmlhelp.h
if not %errorlevel%==0 goto :ERROR
echo Checking File Size
pushd.
cd /D "%TEMP%\chmbuild"
set error=
for /f "delims=" %%a in ('dir /b htmlhelp.chm 2^>NUL') do echo %%~za
popd
if "%error%"=="Y" goto :ERROR
echo Moving from Temp Directory
move %TEMP%\chmbuild\htmlhelp.c
if not %errorlevel%==0 goto :ERROR
goto :EXIT
:ERROR
echo ERROR ENCOUNTERED
exit /B -1
:EXIT
exit /B 0
Sounds like the htmlhelp.chm file doesn't exist in "%TEMP%\chmbuild" at the time of the for statement. How about doing this before the for statement:
if exist "htmlhelp.chm" echo File htmlhelp.chm exists in %cd%
if not exist "htmlhelp.chm" echo File htmlhelp.chm does not exist in %cd%
for /f "delims=" %%a in ('dir /b htmlhelp.chm 2^>NUL') do echo %%~za
...
Business Accounts
Answer for Membership
by: SteveGTRPosted on 2006-05-04 at 14:26:40ID: 16610014
Could it be there is an error from another portion of your script?
hm C:\built-docs\%1-%3.chm
I ran a test of this code that simulates the file size error processing in your code:
@echo off
set error=
for /f "delims=" %%a in ('dir /b "%~1"') do echo if /I %%~za LSS 2000000 set error=Y
for /f "delims=" %%a in ('dir /b "%~1"') do if /I %%~za LSS 2000000 set error=Y
if "%error%"=="Y" echo Error
I ran it against some huge database backup files and it didn't report an error:
05/03/2006 02:52 PM 828,255,744 PMC_20060502_NOREPL.bak
Can you run the test against the file you have the problem with? The batch file accepts the file name and you should run it from the directory where the file exists (cd /D "%TEMP%\chmbuild").
My reference to the "other" error processing deals with the move code:
echo Moving from Temp Directory
move %TEMP%\chmbuild\htmlhelp.c
if not %errorlevel%==0 goto :ERROR
Could that be failing? You'd see the "Moving from Temp Directory" message.