I have a schedule job that performs the following tasks:

1). Exec xp_cmdshell 'erase c:xxxxxxx.txt'
2). Exec @result_ftp=xp_cmdshell c:xxx'ftp.bat'
3). Exec @result_bcp=xp_cmdshell 'c:xxxcp.bat'

How do I make sure that the size of the file after ftp is >0 (ftp successfully)?
How do I write this procedure(just check the size of the file)?
If the ftp does not succefully, the BCP should not start, but the xp_cmdshell command always return 0 which means ran successfully.

Does anyone has an idea? I do appreciate for your help.