Unlock file on Windows Server 2003 by remote desktop without rebooting

fileswindows-server-2003

We've several Windows Server 2003 machines running, each with its own purposes. There are scheduled jobs which synchronizes some files over SFTP using WinSCP. Very sometimes a newly copied file is left locked in the "inbox" folder without any reason. The machine's own background task (programmed in Java) can't move it to the "processed" folder anymore after processing it.

Manually moving it only yields the well known error message Cannot move [filename]: it is being used by another person or program.

I tried Unlocker which works fine locally at WinXP, but doesn't work at those Win2K3 machines by remote desktop (unlock option doesn't show up in rightclick context menu). I tried Process Explorer as well as described in this blog article, but it caused the server to crash and reboot (not sure if that's because it's executed through remote desktop).

The only resort is to reboot the machine, but we would of course like to avoid that. Any suggestions?

Best Answer

What happens if you restart the FileZilla Server service? You could exec net start/stop "FileZilla Server" service from your Java application if it fails to move the file.