WORKINGDIR "C:\encrypted_files" :loop GETNEXTFILE "*.pgp" IFERROR RETURN $ERROR_SUCCESS SETREPLACE filename = %nextfile ".pgp" "" PGPDECRYPT %nextfile filename ;If decryption fails, exit IFERROR RETURN DELETE %nextfile GOTO loop