How do I check if a file is already used by another process from Powerscript ?
You could try to open it and if it errors then it is probably already locked.