When the job fails, does it just not run or does it attempt to run and then fail? What does the job history tell you. Make sure the job write to the event log and check the event log, as well as the sql server error logs, for any hint as to why it is failing.
I am betting it is a permissions issue on the share/folder you are trying to write to.
Also, is the share that you are performing the file manipulations on the same server as SQL Server or is it a remote share on another server?
Thanks
J. Kusch