I am very sorry if this seems like a very simple question, but I cannot compare the two file sizes, where one file is written continuously in a batch script, it does not go beyond the if statement, it just got stuck there and comes up without any action.
: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
source share