Have you run the whole script successfully outside of an agent job? My thinking is confirming whether it is an issue with the script or the script being run in the context of an agent job.
Gaz
-- Stop your grinnin' and drop your linen...they're everywhere!!!