Alright, solved that problem, but now I've got another. In the exist statement, only the files in the immediate directory are searched. I need to have every subfolder included in that search. How do I do that?

if EXIST ("$workingdir\$projfile\*.dgn")