|
-
Nov 9th, 2007, 08:32 AM
#1
Thread Starter
PowerPoster
[2005] Deleting a File In Use?
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
-
Nov 9th, 2007, 08:40 AM
#2
Member
Re: [2005] Deleting a File In Use?
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.
-
Nov 9th, 2007, 08:43 AM
#3
Thread Starter
PowerPoster
Re: [2005] Deleting a File In Use?
 Originally Posted by svanxx
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.
-
Nov 9th, 2007, 09:04 AM
#4
Re: [2005] Deleting a File In Use?
The only way I've ever been able to do this is through DOS.
-
Nov 9th, 2007, 09:07 AM
#5
Thread Starter
PowerPoster
Re: [2005] Deleting a File In Use?
 Originally Posted by Hack
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.
-
Nov 9th, 2007, 09:09 AM
#6
Member
Re: [2005] Deleting a File In Use?
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.
-
Nov 9th, 2007, 09:10 AM
#7
Re: [2005] Deleting a File In Use?
 Originally Posted by jesus4u
I tried issuing the Del command in DOS and I get the same error about the file in use.
Try booting in Safe Mode and see if you can nail it.
-
Nov 9th, 2007, 09:13 AM
#8
Thread Starter
PowerPoster
Re: [2005] Deleting a File In Use?
 Originally Posted by Hack
Try booting in Safe Mode and see if you can nail it.
I would but this is a production server and you know how that goes.
-
Nov 9th, 2007, 09:14 AM
#9
Re: [2005] Deleting a File In Use?
Even production servers get rebooted from time to time right?
-
Nov 9th, 2007, 09:16 AM
#10
Thread Starter
PowerPoster
Re: [2005] Deleting a File In Use?
 Originally Posted by Hack
Even production servers get rebooted from time to time right?
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|