DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

Author Topic: Deleting Folders that don't want to be deleted  (Read 8,209 times)

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 9,827
    • Participated in NANY Challenge Eight Times
    • Cody Award
Deleting Folders that don't want to be deleted
« on: October 08, 2006, 05:42 PM »
I have a folder in a temp directory I use for programs (not a windows temp) and I can't delete it. I was able to delete everything out of it, and I've closed any programs that might be using it. I've even signed into Safe Mode and I still can't delete it.

I keep getting this error message:

Quote
Error Deleting File or Folder

Cannot delete file: Cannot read from the source file or disk.

It isn't read only or hidden, and like I said it's not a system file. It was just a temp directory for making a disc image. One of the weird things about it is that the folder is named after the disc image (without extension) but there are 22 spaces at the end, so it's like
"imagename                      "

I get a similar error message if I try to rename it, too. Any ideas on how I can remove it?

NeilS

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 78
Re: Deleting Folders that don't want to be deleted
« Reply #1 on: October 08, 2006, 06:44 PM »
This might be worth trying:

1. Open a command prompt
2. "cd" to the folder which contains the folder you can't delete.
3. Type "dir /x", and look in the resulting dir listing for the offending folder. You should hopefully see the "short" version of the folder name to the left of the normal name.
4. Type "rd <name>" where <name> is the short name of the folder.

HTH.

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,888
    • Participated in NANY Challenge Six Times
    • Coding Snacks
    • Gathering Badge
    • Cody Award
    • Volunteers/Staff
Re: Deleting Folders that don't want to be deleted
« Reply #2 on: October 08, 2006, 07:15 PM »
If that doesn't work, you can try this:

Remove on Reboot Shell Extension

Important advice:

Install it, use it, then immediately uninstall it.

I am afraid to keep this installed on my system when it's not immediately needed, out of fear of an unfortunate accident may occur and I'll delete files with it by mistake.

JavaJones

  • Review 2.0 Designer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,739
    • Participated in NANY Challenge Once
Re: Deleting Folders that don't want to be deleted
« Reply #3 on: October 08, 2006, 07:21 PM »
A better option may be this super, super handy utility: Unlocker. Lots of features, including a "delete on reboot", and it's free. :)

- Oshyan

jgpaiva

  • Artificial Idiocy
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • Cody Award
    • Participated in NANY Challenge Once
    • Coding Snacks
    • Portugal Inhabitant
    • Linux User
Re: Deleting Folders that don't want to be deleted
« Reply #4 on: October 08, 2006, 08:15 PM »
A better option may be this super, super handy utility: Unlocker. Lots of features, including a "delete on reboot", and it's free. :)

- Oshyan
Definitelly, i also use that.

wr975

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 369
    • Coding Snacks
Re: Deleting Folders that don't want to be deleted
« Reply #5 on: October 08, 2006, 09:16 PM »
Cannot delete file: Cannot read from the source file or disk

Sounds like an error in the file system. Try running Scandisk. Perhaps it'll fix it.

Deozaan

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 9,827
    • Participated in NANY Challenge Eight Times
    • Cody Award
Re: Deleting Folders that don't want to be deleted
« Reply #6 on: October 09, 2006, 01:27 AM »
This might be worth trying:

1. Open a command prompt
2. "cd" to the folder which contains the folder you can't delete.
3. Type "dir /x", and look in the resulting dir listing for the offending folder. You should hopefully see the "short" version of the folder name to the left of the normal name.
4. Type "rd <name>" where <name> is the short name of the folder.

HTH.

This worked. I thought I tried command prompt before, but I guess I forgot the command to delete the folder. I think I was using "delete" instead of "rd"

I'll run scandisk anyway.

Thanks everyone!

f0dder

  • [Well, THAT escalated quickly!]
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 9,153
    • Participated in NANY Challenge Once
Re: Deleting Folders that don't want to be deleted
« Reply #7 on: October 09, 2006, 03:08 PM »
chkdsk (not scandisk, that's win9x stuff) is a good idea when you get weird errors - sometimes a very small corruption (that doesn't really do much harm and can be fixed 100% undestructively by chkdsk) can cause very weird program behaviour.

Also, though, sometimes some program that really don't need to has file/folder handles open. Frustrating.
- carpe noctem

Original address: https://www.donationcoder.com/forum/index.php?topic=5683.0