if not exist MyFolderName ( ECHO create a folder mkdir MyFolderName )
所以你的语法应该是:
if not exist MyFolderName ECHO "Create a folder" & mkdir MyFolderName
UPDATE
或者您可以使用标签跳转到包含要执行的命令的部分,例如:
if not exist MyFolderName GOTO DOFILESTUFF :AFTER ... EXIT :DOFILESTUFF ECHO "Create a folder" mkdir MyFolderName GOTO AFTER