Kill all program.exe instances open on network share from Windows
If your windows version has powershell (if not, you can download and install from microsoft site), it is very easy as well
get-process "program.exe" | stop-process -force -confirm:$false
Look here: http://support.microsoft.com/kb/290585/en-us
I believe this still applies to current Windows versions, or should at least put you in the right direction.
Command line:
for /f "skip=4 tokens=1" %a in ('net files') do net files %a /close
Batch file:
for /f "skip=4 tokens=1" %%a in ('net files') do net files %%a /close