The script shown is exactly what I'd use to export a file named "export" to the desktop of any computer that has access to your database. I see no reason why it would fail.
Your answer directed me to another probable cause: permissions. Changing the used password to a higher one solved it. So, now I have got to tweak the permissions to get it right.
Thanks for your confirmation of my script steps.