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 statem
One issue is the parenthesis after the if compare - it must be on the same line:
if %size% EQU %parsize% (
if cond (
...
) else (
...
)
if cond (...) else (...)
if cond (...) else command
if cond (...) else (
....
)
if cond (
....
) else command
The placement of the parenthesis matters. The if
opening parenthesis needs to be on the same line that the if
command. The if
closing parenthesis needs to be in the same line that the else
clause (if present). The else
opening parenthesis needs to be in the same line that the else
clause.
if %size% EQU %parsize%
causes error
if opp condition opp2 command
if you modify follow this this will work
IF %size% == %parsize% ECHO file is complete > C:\Users\finoy\status.log ping -n 5 127.0.0.1 > nul
else echo incomplete > C:\Users\finoy\status.log ping -n 5 127.0.0.1 > nul