I tried your script with my own setup and received the access denied too. I changed it to what I put below and it worked for me. Obviously weather you can do the delete or not is based on your credentials and setup on the server side.
option confirm off
option transfer binary