Dispatch to check for possible duplicate filename when renaming

With Dispatch is there a way to find if a file with a certain name exists anywhere in the vault. I am able to check for an existing file when i know the directory it resides in but what if the file may exist anywhere in a vault. The rename action will error out but the script continues.

What I am attempting to do is rename files based on a variable but there will be instances when it will create a duplicate filename. In those cases I would like to use an OK message box with instructions for how the user should proceed. And because I want to run the dispatch script during a transition I need to be able to Cancel SW command.

SolidworksSolidworks Pdm/enterprise Pdm