Deleting a file that is locked by another program

plucier

New member
Joined
Feb 17, 2004
Messages
2
Hey everybody. Im not a programmer myself, but Im working with a group of programmers and weve run into a problem. We have a situation where we need to delete files on a network drive. All files on this drive are flagged as read-only, but there is one piece of software that still creates a link to the file that prevents us from deleting it. Weve tried using windows commands, dos shell commands with every possible combination of switches with no success. The only thing we can do is overwrite the files using a dos shell with an xcopy and a read-only flag switch.

I was wondering if anyone else has ever encountered this type of problem and if theres a way to sever the link of a program to that file. The software thats keeping the link is not providing us with an API call to kill the link so far, and Im looking for anything that may be in Visual C# .NET that can be used, or a Windows SDK function or anything. Were trying to get away from the DOS shell as much as possible for error tracking purposes.

Thanks!

Paul
 
We did find a tool on the internet that was able to resolve the problem for us. The tool is called psfile.exe and it is a DOS based tool. Worked really well for us. Here is a link to some info

www.sysinternals.com

Hope this helps!
 
Back
Top