I not sure if Windows or DOS keeps track of locked files. A very inelegant solution would be to get a list of the files and then attempt to open each for reading. If successful, you'd know the file was unlocked and if unsuccessful, you'd know the file was locked.
VBScript would be one solution, but if the list of files was large, the script would run at glacial speed and the overhead on the I/O subsystem would be horrendous.