I want to know if there is any way, API, .NET, that I can delete a text file on a Windows 2003 server that is in use by another process?
Thanks
Alex
Printable View
I want to know if there is any way, API, .NET, that I can delete a text file on a Windows 2003 server that is in use by another process?
Thanks
Alex
I believe it will throw an error if you try to do that. I'm not sure if it's possible but maybe you can get control of that process and tell it to close it's connection to the textfile, then delete the file.
Yes it does throw an error.Quote:
Originally Posted by svanxx
The only way I've ever been able to do this is through DOS.
I tried issuing the Del command in DOS and I get the same error about the file in use.Quote:
Originally Posted by Hack
If the text file is not in continuous use by the other process, another way that I can think of is using a command to check if the file is being used. Something similar to when you check if a file exists before reading from it.
Try booting in Safe Mode and see if you can nail it.Quote:
Originally Posted by jesus4u
I would but this is a production server and you know how that goes.Quote:
Originally Posted by Hack
Even production servers get rebooted from time to time right?
Quote:
Originally Posted by Hack
Yah don't I know it. I work for a large Fortune 100 Company so reboots during production hours are really tough to get approved. I was just looking for a work around.