SoftwareTipsandTricks Forum

Go Back   SoftwareTipsandTricks Forum > Operating Systems > Windows XP
User Name
Password


Cannot Delete File On Desktop.

Reply
 
Thread Tools Search this Thread Rating: Thread Rating: 3 votes, 4.00 average. Display Modes

  #31  
Old 09-19-2006, 03:00 PM
bwadden Offline
Registered User
 
Join Date: Sep 2006
Posts: 1
Can't delete file from desktop

Easy fix that worked for me.

Login under a different user name.
Copy the the contents of the desktop folder with the erroneous file( do not attempt to copy the erroneous file) to a temporary directory
Open cmd prompt
Go to the problem user files and use the command "rm /s Desktop"
Create a Folder called "Desktop"
Copy all the files in the temporary directory back into the new desktop folder
Logout
Login as new user
Reply With Quote

  #32  
Old 03-26-2007, 06:46 PM
BingBing's Avatar
BingBing Offline
Registered User
 
Join Date: May 2005
Posts: 2
You have a FOLDER on your desktop with a FILE in it, which you cannot delete, right?

You’re given this message:

Cannot read from the source file or disk.

You have uninstalled many programs that you suspect they may cause the problem;… negative.

You booted up in Safe Mode, tried to EndTask explorer.exe while doing some hacks in cmd prompt like deleting the folder and…

You read “How to delete a file when…” article;… negative.

You tried to do “Open with…” then created a file with the same name, saved over the existing one… with no luck.

You have no Spyware, no virus and nothing suspicious at all.

In the end, before installing a fresh damn Windows, why don’t you try this one:

at a cmd prompt:

RD /S /Q [drive:] path

example:

C:\Documents and Settings\[your log-in name]\Desktop\>RD /S /Q foldername

Another example: assume I have such a bad folder on my desktop; its name is StupidFolder, and there is a file inside it, named INSTR. with a zero length and no other retrievable properties, or perhaps it has a creation date. And my windows log-in name is dlb, ok! Now:

* Run -> cmd.exe
* cd c:\Documents and settings\dlb\Desktop\
* rd /s /q stupidfolder


A little background about RD command

It goes back to the era of MS DOS. At that time, let say DOS 6.3, you could MakeDirectory(s) with this command:

c:\> md my-letters

It was also easy to RemoveDirectory(s) with the following command:

c:\> rd my-letters

However, the directory that you had attempted to remove had to be ”empty”, otherwise, you could not remove it. You also ”could not delete” a directory with the following command:

c:\> del my-letters

because the delete command could work only on ”files” not ”folders”. Then, when your folder was not empty, you first had to go inside that folder, delete everything, come out of the folder, and finally remove it. Still, if there were ”many” folders inside one another residing in the main folder that you wanted to remove, you had faced a nightmare.

Luckily, there was a solution for that: deltree. It was not a native command of command.com (command.com was a kind of the kernel of the operating system). It was an external file that you could obtain from elsewhere and use it for that purpose. Then your computer could automatically go to the deepest directory, delete everything in it by this command:

[drive:]\path>del *.*

(without asking permission from the user except once at the start time) and remove every directory that may be there by an rd command, come up by one sub-directory and repeat these steps again up to the first directory.

Since the Win 2000 emergence, the external command of deltree went inside the RemoveDirectory command as its switch or parameter, named /s. Then we have had this command:

rd /s [drive:]path

that does this:

deltree [drive:]path

It “removes all directories and files in the specified directory in addition to the directory itself. Used to remove a directory tree,” its help says.

Notice:

* RD and RMDIR are identical comands.
* You can also use it this way if you don’t like working directly with cmd.exe:

Start, Run…
cmd /C RD /S /Q “C:\Documents and Settings\username\Desktop\StupidFile

but, replace the username and StupidFile with your own cases. So the general command would be:

cmd /c rd /s /q “[drive:]path”

* Generally speaking, no file in the destination path must be currently in use, which means if the path is not empty, no program must be using any file(s) from inside of it. That is why we say, ‘close all applications; even go to task manager and close every program that you can (not the windows itself)’.
* If you considered the above-mentioned item, it would be much better to even End Process Tree of explorer.exe from your task manager, and use the task manager ‘File -> New Task (Run)…’ etc, etc. Doing this, you make sure that at least there is no open file handle from explorer.exe to anything inside the StupidFile. When you finished, you can bring your explorer (and your desktop) back by ‘File -> New Task (Run)… -> explorer (and [Enter], of course!).

Received comments - Adaptations, Hints, and Tricks

I am receiving great comments full of love. I also love you all, my friends. In some of received e-mails, I got some variations of the rd method that I would be honoured to share with you.

An adaption by Uhl Albert:

I had tried a bunch of solutions from your page (and elsewhere) but none of them worked. This is what finally did it for me:

1. Log into Windows as another user [must be a user with all administrative privilege]
2. Open Windows Explorer and navigate to: \Documents and Settings\UserName <–user name with the bad files
3. Go to Tools Folder Options and click the View tab. Make sure all settings that hide files are turned off. You want to make sure all files are visible before the next step
4. Move all the files in the Desktop folder to another location (well all except the problem files.. .if those could be moved you wouldn’t be in this predicament!)
5. Open a command prompt and navigate to the above location
6. Enter this command which deletes the Desktop folder and its contents: RD /S Desktop
7. Create a new Desktop folder
8. Move everything back
9. Log off, then log in again as the original user

My complementary notes on the adaptation:

When you are using this method, you should have Administration privilege. Otherwise you would never be allowed to delete the actual Desktop folder of any user in any circumstances.

The problem of more-than-8-charts-long names: Noticed by Nicolas Huguenin

… the folder I wanted to delete had a very long name (two times wrapped in the CMD) so I wasn’t able to delete it with its long name using the rd command. But using first a dir /x to get the 8-chars name of the folder, I could finally remove it with the rd /s/q.

You may want to add that trick to your otherwise great tutorial, as many of the “young” users might not even know that one day (not so far ago) all names were 8-chars max

My complementary notes on the trick: what does dir /x mean?

Well, it is a wise move. Because there are always some instances of horribly long file names with lots of symbols and spaces in between them. This would make applying rd impossible for folders with space in their names. This makes applying many other MD-DOS command impossible too.

Example:

1. I created a folder on my desktop called ‘Stupid Test‘. Note that there is a space between Stupid and Test
2. Now I want to remove this folder with rd command. Then I write:

C:\…\Desktop> rd Stupid Test

And I receive the following messages (one message, two times):

The system cannot find the file specified.

The system cannot find the file specified.

What is the problem? The ‘Stupid Test’ folder is there. Then why the rd command cannot find it? The problem is that the rd command interpreter, like many other MS-DOS commands, cannot understand the space in the name of a file or a folder. It looks for a folder with the name of ‘Stupid’ and a folder with the name of ‘Folder’, but does not look for a folder with the name of ‘Stupid Test‘. Then it says, ‘the system cannot find the file specified’ two times, once for each part of the name. This behaviour is ridiculous, isn’t it?! Yes, it is, I believe, and so did guys in Microsoft.

Years agon, names of folders couldn’t be longer than 8 character, because of some profound restrictions in the available ‘file
management’ system, and names also couldn’t bear any space in them. They also used to be started with a letter, not a number. We also couldn’t have some symbols in the name of a file or folder. It sounds awfully restrictive. Then Microsoft changed everything, and eliminated this absurd limitation in its later operating systems, i.e. in its file management system.

However, for the sake of some backward compatibilities, Microsoft decided not to set MD-DOS commands totally apart. So, This problem is inherited from MS-DOS to its descendants. Today, still some of figuratively MS-DOS commands in Windows family face the same difficulty that their predecessor had faced. They cannot understand longer than 8-charts names, nor can they understand folder names containing any space.

What is the solution?

Microsoft guys have provided us a tool to tackle such a complication. The solution is using dir /x.

The purpose of using dir /x is to create 8-charts long MS-DOS compatible file and folder names that are placed in the current folder (if the desktop is your current folder in DOS prompt, then it means dir /x gives 8-charts long names of all files and folders in your Desktop.) Then we can use their 8-charts equivalents with all spaces eliminated and long names shortened up to 8 characters. For instance, a name like:

‘Test 123456789‘

would be contracted to: ‘TEST12~1‘, or a name like: ‘123456789 123456789 123456789‘ would be contracted to :

‘123456~1‘. By doing this, we have 8-charts long names without space in them that can be understood by many MD-DOS commands in Widows family, let say in Win XP.

Now, let’s go back to our ‘Stupid Test‘. Assume you are in your Desktop (that means your current folder is C:\…\Desktop):

C:\…\Desktop>

1. To see what exactly dir /x does, type ‘dir‘. You’ll see a list of the names of all files and folders on your desktop, and you’ll see our ‘Stupid Test’ folder there as well
2. Now, type: C:\…\Desktop>dir /x. You’ll see, again, a list of the names of all files and folders on your desktop, but all longer-than-8-charts names are also given their 8-charts long equivalents this time. So you’ll see that our ‘Stupid Test‘ folder has the 8-charts name of ‘STUPID~1‘
3. Again, try the rd command, but this time give the contracted name:

C:\…\Desktop>rd stupid~1

Last edited by The Tool : 04-13-2007 at 09:07 AM.
Reply With Quote

  #33  
Old 04-01-2007, 10:14 AM
brokenxsound Offline
Registered User
 
Join Date: Apr 2007
Posts: 1
not sure if anyone has tried this, but i recently had a file i downloaded that could not be deleted, moved, copied, renamed, or even have its properties checked. this file also had an incredibly long file name as well as a 0kb file size. move on boot couldn't remove it nor could many of the suggestions on this thread. so i decided for a different approach. first i moved all of the good files in the folder to another folder temporarily. next i selected the folder the corrupted file was in and then clicked delete. presto, bad file gone. next i just renamed the folder that i moved my good files into. most windows folders such as the desktop, my music, my pictures, my downloads, anything of that nature will automatically be made if for some reason you have to delete them. in my case it was the my music folder since that was my original download folder from peer to peer programs. hope this helps someone.
Reply With Quote

  #34  
Old 04-05-2007, 05:52 AM
Hai Offline
Registered User
 
Join Date: Apr 2007
Posts: 1
alpharesearch has provided a good answer to soulm4t3 (by running command prompt and stopping explorer.exe) that is similar to what I have used to delete files that cannot be deleted in safe mode. There are some other methods:

This tip is for Windows XP. If you are sure that such file is not an important system file, there are four methods to delete it. Choose one:

a) Take out the hard disk and connect to other computer as external drive. Then delete the file.

b) Format the hard disk (and reinstall the OS. Ouch!).

c) Run Command Prompt. Next, run Task Manager. In Task Manager, choose "explorer.exe" from the processes list and click End Process. Taskbar will disappear. Then go back to Command Prompt and type "del" followed by the location of the file, for example "del c:\winnt\1.dll" to delete the file. Finally return to Task Manager, click New Task (Run...) under the File menu, write "explorer.exe" and press enter to get back the taskbar.

d) Use the "Remove file" utility in the freeware like Spyware Terminator. The utility will remove the file right before entering Windows during reboot. You may not want to use some freeware programs that integrate this powerful file removal feature on the right click menu because when it is too easy to access, mistake like accidental deletion of important system file can happen.

If a software cannot be uninstalled by the "Add or Remove Programs" function in Control Panel, again Spyware Terminator can do the job. Just run a fast scan and on the scan report tick on that software and click "Remove".

I hope everybody can read all the replies first before posting.

Last edited by The Tool : 04-13-2007 at 08:59 AM.
Reply With Quote

  #35  
Old 05-06-2007, 08:27 PM
andrewd Offline
Registered User
 
Join Date: May 2007
Posts: 2
Unhappy It almost worked.

Quote:
Originally Posted by titch98
Do not know if this information is going to be of any use to you (but may be, that is why I have posted it...!!).

I recently had a similar problem with an .NFO file on my Desktop which I could do absolutely nothing with (or so I thought.......). Kept reporting back "Cannot read from the source file or disk" on tying to delete, rename, move and open. Quite a bit concerned about doing a complete reinstallation of OS considering had done one only a week ago after an unrelated issue. Then thought I would try something........

I Right-Clicked on the file icon and in menu selected "Open with....". Selected Notepad as program to use (.NFO is a system Info text file). The PC returned the following error......."This file does not exist......would you like to create a new one?". Clicked on "Yes" and was given a blank Notepad screen, where I scribbled some text and then tried to save the data......which it did! I now had a working file with data in it which I could, and did, delete.

So, suggestion...........

Try to find a program (if you do not already have one) that will run the extension type of the file trying to be deleted and install on your PC. Go through the method I used for my .NFO file (i.e. Right-click -> "Open With...." -> chooose your program for the file extension etc.) and see if this method works for you.

Hope this helps in some way or another..............

I've been looking for a solution to a problem I've had for a long time. I've had a file on my desktop with the name "a good joke..." What was weird were the 3 dots at the end of the name. Then in the last week a 2nd file appeared. Both names seem to be the subject of an email. And nothing I've tried so far was able to delete them. So I tried this trick. I thought it worked, as I was able to delete the file after saving it in notepad. The I realized that when I saved the file with notepad it actually created a new file without the 3 dots in the file name. So I still can't delete the files. It's very frustrating.
Reply With Quote

  #36  
Old 05-06-2007, 08:49 PM
andrewd Offline
Registered User
 
Join Date: May 2007
Posts: 2
Thumbs up Files successfully deleted!

Quote:
Originally Posted by andrewd
I've been looking for a solution to a problem I've had for a long time. I've had a file on my desktop with the name "a good joke..." What was weird were the 3 dots at the end of the name. Then in the last week a 2nd file appeared. Both names seem to be the subject of an email. And nothing I've tried so far was able to delete them. So I tried this trick. I thought it worked, as I was able to delete the file after saving it in notepad. The I realized that when I saved the file with notepad it actually created a new file without the 3 dots in the file name. So I still can't delete the files. It's very frustrating.
OK, I guess I should have kept reading! I had to log in as another user, moved all my desktop files to a backup folder, then delete the desktop folder using the rd command mentioned in another post. The create a new desktop folder and copy all my files back. What a pain! Thanks to all who posted solutions to this problem.
Reply With Quote

  #37  
Old 05-07-2007, 12:44 AM
apatosaurus237's Avatar
apatosaurus237 Offline
Registered User
 
Join Date: Sep 2005
Posts: 82
i had the same problem a few months ago,
instead an easy solution was run chkdsk C:
rebooted, it ran the tests, found a bad sector and when i went back into XP it was gone
Reply With Quote

  #38  
Old 05-07-2007, 03:50 PM
CONFUSER's Avatar
CONFUSER Offline
Registered User
 
Join Date: Sep 2002
Location: AM2 SPACE
Posts: 23
Send a message via ICQ to CONFUSER Send a message via AIM to CONFUSER
Also unlocker (FREE) will do it and unlock other files you can delete. Right click extenstion. Super App.
Reply With Quote

  #39  
Old 07-21-2007, 02:01 AM
holly19 Offline
Registered User
 
Join Date: Jul 2007
Posts: 1
Great Solution

Quote:
Originally Posted by ricbri
THIS LITTLE PROGRAM DOES THE JOB IN UNDER A MINUTE!

DelinvFile

http://www.purgeie.com/delinv.htm


THIS is the perfect solution - very quick and easy.
Reply With Quote

  #40  
Old 12-29-2007, 07:34 PM
chrisncali23 Offline
Registered User
 
Join Date: Dec 2007
Posts: 2
Smile "Cannot Delete File or Folder on desktop"

Hello I recently had a problem deleting a file off of my desktop, I typed the error message into my google toolbar and found this forum, I also found another forum where someone posted a link to download a program called unlocker. Here is the link and if anyone has future problems like this, I think this is a great solution because it worked for me.


http://www.jakeludington.com/ask_jak...r_er ror.html


Just read and find the link that says download the freeware app unlocker.
Reply With Quote

  #41  
Old 04-13-2008, 07:37 PM
Carleigh91 Offline
Registered User
 
Join Date: Apr 2008
Posts: 1
Thanks!!

Quote:
Originally Posted by ricbri
THIS LITTLE PROGRAM DOES THE JOB IN UNDER A MINUTE!

DelinvFile

http://www.purgeie.com/delinv.htm
Hey your awesome.. this works great
Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot delete avi file. ryanwhalen Windows XP 18 07-12-2006 12:04 PM
[HELP PLZ] Can't Delete A File XenoBreak Windows XP 22 02-12-2006 05:26 PM
rewriter not working! skoundrel Windows XP 6 05-29-2005 01:31 PM
cannot delete a .exe file tdq Windows XP 2 05-29-2005 01:26 PM
Cant delete a file :( slowjamz Windows XP 6 11-14-2004 10:17 AM



All times are GMT -5. The time now is 12:34 AM.


Designed by eXtremepixels. Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 2.3.2 © 2005, Crawlability, Inc.