DOS Batch file EQU function

Microsoft Windows xp professional w/sp2
December 3, 2009 at 03:27:03
Specs: Windows XP
I have a batch file as follows and echo prints out 'filesize' when the file is of 0 size but doesn't print out 'filesize_more_0 when the file has data in it.

I've been looking through the forum so the code is similar to other codes samples

:: chkzero.bat
@echo off
set DD=%DATE:~0,2%
set MM=%DATE:~3,2%
set YY=%DATE:~8,2%
set YYYY=%DATE:~6,4%
set HH=%TIME:~0,2%
set HH=%HH: =%
set MN=%TIME:~3,2%
set SS=%TIME:~6,2%
echo %FOLDER%
for %%R in (e:\"IBIS FTP"\test.dat) do if %%~zR equ 0 echo filesize
for %%R in (e:\"IBIS FTP"\test.dat) do if %%~zR lss 1 echo filesize_more_0



See More: DOS Batch file EQU function

Report •

December 3, 2009 at 03:32:51
Apologies, i know there's info in there relating to datetime. I intend to move the zero byte files to a directory of this name and this works. I just didn't include it in the code.

Report •

December 3, 2009 at 06:17:32
I was able to sort this. it was related to the double quotes " in the path. I put them at the start and end and this resolved it.

Report •

Related Solutions

Ask Question