I am assuming that the table or query you wish to export is "Ztest" and that the file you wish to export it to is export.txt. I am also assuming that you are not using any specification. Type this code as is and let me know if it works.
Actually I want to use an export specification file. Reading all the help files it says the the file must be called Schema.ini and then it must contain the name of your export file. I created the schema.ini file and put in some basic stuff to see if that would work but that gives me the does not exist error. See my first message for the schema.ini contents.