Results 1 to 10 of 10

Thread: [2005] Deleting a File In Use?

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Question [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

  2. #2
    Member svanxx's Avatar
    Join Date
    Oct 2007
    Location
    Orlando, FL
    Posts
    37

    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.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Re: [2005] Deleting a File In Use?

    Quote 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.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2005] Deleting a File In Use?

    The only way I've ever been able to do this is through DOS.

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Re: [2005] Deleting a File In Use?

    Quote 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.

  6. #6
    Member svanxx's Avatar
    Join Date
    Oct 2007
    Location
    Orlando, FL
    Posts
    37

    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.

  7. #7
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2005] Deleting a File In Use?

    Quote 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.

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Re: [2005] Deleting a File In Use?

    Quote 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.

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2005] Deleting a File In Use?

    Even production servers get rebooted from time to time right?

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Jan 2001
    Location
    Florida
    Posts
    3,216

    Re: [2005] Deleting a File In Use?

    Quote 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
  •  



Click Here to Expand Forum to Full Width