' Create file and dir TRAP LOCAL OPEN "output.txt" FOR WRITING AS afile CLOSE FILE afile CATCH GOTO report OPEN "/output.txt" FOR WRITING AS afile CLOSE FILE afile LABEL trydir MAKEDIR "docs" CATCH GOTO report2 MAKEDIR "/docs" END LABEL report PRINT ERR$(ERROR) GOTO trydir LABEL report2 PRINT ERR$(ERROR)