I'm sorry if it seems a very basic question, but I cant compare two file sizes where one file is being written continuously in batch script, it doesn't go beyond if statement, just get stuck there and comes out without doing anything.
:START
copy C:\Users\Admin\ping.txt C:\Users\Admin\ping.partial
set file="C:\Users\Admin\ping.txt"
set parfile="C:\Users\Admin\ping.partial"
ping -n 5 127.0.0.1 > nul
FOR %%A IN (%file%) DO set size=%%~zA
FOR %%B IN (%parfile%) DO set parsize=%%~zB
echo %size%
echo %parsize%
if %size% EQU %parsize%
(
ECHO file is complete > C:\Users\Admin\status.log
ping -n 5 127.0.0.1 > nul
)
else
(
echo incomplete > C:\Users\Admin\status.log
ping -n 5 127.0.0.1 > nul
goto start
)
What I'm doing wrong here. :(
Regards, Gaurav