Does this help?
Sysinternals is a suite of utilities that was acquired by Microsoft a few years ago. The suite of tools is now called PsTools, current version is 2.44. One of the utility files is psfile which will allow you to ID files that are opened by a remote connection and enable you to close the file by filename.
See here:
http://technet.microsoft.com/en-us/sysinternals/bb897552.aspx for info on the file.
See here to download the suite:
http://technet.microsoft.com/en-us/sysinternals/bb896649.aspxFrom the command line help:
PsFile lists or closes files opened remotely.
Usage: psfile [\\RemoteComputer [-u Username [-p Password]]] [[Id | path] [-c]]
-u Specifies optional user name for login to
remote computer.
-p Specifies password for user name.
Id Id of file to print information for or close.
Path Full or partial path of files to match.
-c Closes file identified by file Id.
Omitting a file identifier has PsFile list all files opened remotely.
------------------------------------------------------------------------
-----------
So, syntax to close the file would be something like this:
psfile C:\Sesame2\Sesame.exe -c
You can use this to see if anyone is currently connected to the file before closing it. This also has the advantage of allowing you to close a file even if it is open by another user, useful for nightly backups when people forget to exit their programs properly.