Solved

Error Message "Cannot delete file: Cannot read from the source file or disk"

Posted on 2003-11-07
54
211,472 Views
Last Modified: 2011-08-18
When i try to delete a folder it gives me the following error message, "Cannot delete file: Cannot read from the source file or disk" why is this? and who can i delete it ?
0
Comment
Question by:Marcos908
54 Comments
 
LVL 49

Expert Comment

by:sunray_2003
Comment Utility
0
 
LVL 44

Assisted Solution

by:CrazyOne
CrazyOne earned 62 total points
Comment Utility
Ok I think what has happened is that the hacker has added a character to the end of the folder that

Explorer does not recognize.

Try this open a command window and do this

Open a CMD.EXE window.
CD to the top of the mess.
Use: DIR /X /A   to see the SHORT FILE NAMES of the files and directories there.
Use a combination of CD, RD, and DEL and the SHORT FILES names reported with DIR /X to delete

your way to the bottom and then back up the tree removing the files on the way down and the

directories on the way up.
Most likely there is NOT a protection issue here so you shouldn't need worry about ownership or file

protections.

RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path

   /S      Removes all directories and files in the specified directory
           in addition to the directory itself.  Used to remove a directory
           tree.

   /Q      Quiet mode, do not ask if ok to remove a directory tree with /S


This MS KB article may help

How to Remove Files with Reserved Names in Windows
http://support.microsoft.com/default.aspx?scid=kb;en-us;120716

BEGIN ARTICLE

--------------------------------------------------------------------------------
The information in this article applies to:

Microsoft Windows 2000 , Professional
Microsoft Windows 2000 , Server
Microsoft Windows 2000 , Advanced Server
Microsoft Windows 2000 , Datacenter Server
Microsoft Windows NT Server versions 3.1 , 3.5 , 3.51 , 4.0
Microsoft Windows NT Workstation versions 3.1 , 3.5 , 3.51 , 4.0
Microsoft Windows NT Advanced Server
--------------------------------------------------------------------------------

SUMMARY
Because applications control the policy for creating files in Windows, files sometimes are created

with illegal or reserved names, such as LPT1 or PRN. This article explains how to delete such files

using the standard user interface.

MORE INFORMATION
NOTE : You must be logged on locally to the Windows computer to delete these files.

If the file was created on a file allocation table (FAT) partition, you may be able to delete it under

MS-DOS using standard command line utilities (such as DEL) with wildcards. For example:

DEL PR?.*

-or-

DEL LPT?.*

These commands do not work on an NTFS partition as NTFS supports the POSIX subsystem and

filenames such as PRN are legal under this subsystem. However, the operating system assumes the

application that created them can also delete them; therefore, you can use commands native to the

POSIX subsystem.

You can delete (unlink) these files using a simple, native POSIX application. For example, the

Windows Resource Kit includes such a tool, Rm.exe.

NOTE : POSIX commands are case sensitive. Drives and folders are referenced differently than in

MS-DOS. Windows 2000 and later POSIX commands must use the following usage syntax:
posix /c <path\command> [<args>] IE: posix /c c:\rm.exe -d AUX.

Usage assumes Rm.exe is either in the path, or the current folder:
rm -d // driveletter / path using forward slashes / filename
For example, to remove a file or folder named COM1 (located at C:\Program Files\Subdir in this

example), type the following command:
rm -d "//C/Program Files/Subdir/COM1"
To remove a folder and its entire contents (C:\Program Files\BadFolder in this example), type the

following command:
rm -r "//C/Program Files/BadFolder"
Another option is to use a syntax that bypasses the normal reserve-word checks altogether. For

example, you can possibly delete any file with a command such as:
DEL \\.\ driveletter :\ path \ filename
For example:

DEL \\.\c:\somedir\aux

--------------------------------------------------------------------------------
Published Jun 3 1997 7:28AM  Issue Type  
Last Modifed Dec 22 2001 12:57PM  Additional Query Words 3.10 prodnt CON PRN AUX CLOCK$ NUL

COM1 LPT1 LPT2 LPT3 COM2 COM3 COM4 winnt  
Keywords kbusage  

COPYRIGHT NOTICE. Copyright 2002 Microsoft Corporation, One Microsoft Way, Redmond,

Washington 98052-6399 U.S.A. All rights reserved.

END ARTICLE
0
 

Author Comment

by:Marcos908
Comment Utility
This hasn't been much helpful is there a more easy way to delete the folder? like thru the registry maybe?
0
 
LVL 49

Expert Comment

by:sunray_2003
Comment Utility
0
 
LVL 21

Expert Comment

by:gemarti
Comment Utility
What version of XP are you running? XP PRofessional or XP Home?
0
 
LVL 21

Expert Comment

by:gemarti
Comment Utility
Also are you trying do delete a folder in the Documents and Settings folder that isn't under your username?
0
 
LVL 49

Expert Comment

by:sunray_2003
Comment Utility
0
 
LVL 44

Expert Comment

by:CrazyOne
Comment Utility
Marcos908 did you even try what I posted most of the time it works. Also boot to safe mode and try deleting it there.
0
 
LVL 44

Expert Comment

by:CrazyOne
Comment Utility
Also are you logged in as the administrator
0
 

Author Comment

by:Marcos908
Comment Utility
I'm am using XP Professional and i am not trying to delete a folder in the Documents and Settings folder, the folder which i am trying to delete is c:\Program Files\Mcafee VirusScan Professional Edition 7.00 there is nothing in the folder (0 bytes) has no creation date no nothing! And CrazyOne i have tried what you have posted but it has not worked i am also logged in as the administrator.
0
 
LVL 44

Expert Comment

by:CrazyOne
Comment Utility
0
 
LVL 44

Expert Comment

by:CrazyOne
Comment Utility
Oops sorry Sunray already posted that link. Did you try what is in that link
0
 

Author Comment

by:Marcos908
Comment Utility
Yes i have tried what is in the link you have provided me but i still cannot resolve my problem.
0
 
LVL 65

Expert Comment

by:SheharyaarSaahil
Comment Utility
have u tried to delete this folder in SAFE MODE......or by using COMMAND PROMPT??
0
 

Author Comment

by:Marcos908
Comment Utility
Yes i have tried deleting the folder in SAFE MODE and also by using COMMAND PROMPT.
0
 
LVL 21

Expert Comment

by:gemarti
Comment Utility
Did you just recently uninstall McAffee AV? Maybe it didn't get completely uninstalled.

Do a CTL ALT DEL and click on the Task Manager Button
See if there is any remenant programs for McAffee running. I can't remember thier names, but I think they have AV in them. If so end the tasks and then try deleting the folder.

Try this:
START | SETTINGS | CONTROL PANEL
See if McAffee is in the Add/Remove Programs list if it is try to uninstall it.

Run RegCleaner. It is a freeware program an you can download it at this site.
http://www.setiathomescreensaverspeed.co.uk/index.html
0
 

Author Comment

by:Marcos908
Comment Utility
i need help guys!!!
0
 

Author Comment

by:Marcos908
Comment Utility
none of the above has done something
0
 
LVL 44

Expert Comment

by:CrazyOne
Comment Utility
Ok this try this

First do this
Access To All Drives And Folders policy
Control Panel >  Administrative > Local Security Policy.
Security Settings > Local Policies > Security Options. Locate the "Recovery Console: Allow Floppy Copy And Access To All Drives And Folders" policy. Double-click this policy, and then set it to "Enable".

or edit the registry
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Setup\RecoveryConsole
SetCommand (DWORD) 1 = allow floppy copy etc, 0 = restrict some file
copying

Then when you get into the Recovery Console you need to use the SET command to get a few things to work,

SET AllowAllPaths = TRUE

Then run this command

RD "c:\Program Files\Mcafee VirusScan Professional Edition 7.00"


Description of the Windows XP Recovery Console
http://support.microsoft.com/search/preview.aspx?scid=kb;en-us;314058

To start the Windows Recovery Console, use any of the following methods:
Start your computer by using the Windows Setup floppy disks or the Windows CD-ROM. At the "Welcome to Setup" screen, press F10 or press R to repair, and start the Windows Recovery Console.
=================
0
 

Author Comment

by:Marcos908
Comment Utility
When i type RD c:\Program Files\Mcafee VirusScan Professional Edition 7.00 in cmd.exe after doing what you told me to do in the Recovery Console it gives me the following:
The system cannot find the file specified.
The system cannot find the path specified.
The system cannot find the file specified.
The system cannot find the file specified.
0
 
LVL 44

Expert Comment

by:CrazyOne
Comment Utility
Did you put this

c:\Program Files\Mcafee VirusScan Professional Edition 7.00

in quotes like I showed you. :)

"c:\Program Files\Mcafee VirusScan Professional Edition 7.00"
0
 
LVL 65

Expert Comment

by:SheharyaarSaahil
Comment Utility
so buddy.....is ur problem solved.....or still creating trouble for u :)

well im not sure but u can try one of the following steps:

1) Strat ur computer in safe mode and then scan ur hard drive for the errors with the option "Scan and attempt for bad sectors" as checked; remember do it the safe mode otherwise it will take hours to complete as there are many applications running in background in the normal mode.....so do it in the safe mode.

2) Defragment ur hard drive....do it also in the safe mode.

3) Also try to remove all the registry entries of McAfee Virus scan from both Current User and H_Key_Local_Machine folders. the registry entry should be a folder named Mcafee and if u had installed Mcafee firewall too....then there will be another folder named Mcafee.com.....delete both these folder from the regedit.

the reason for ur problem is probably coz of some misplacing of the hard drive sectors.....means windows has already removed this folder from the memory of the system.....but due to some problem or some wrong operation it has remained on any of the cluster of the hard drive......so u can see the folder on ur hard drive but when u ask window to delete it......it says that it has alreday deleted it......!!

i myself got this problem many times when i had a win98 system......i don't know abt ur operating system but i always used this method to get rid of these unwanted folders.......i just went into the safe mode and deleted it......and if still it couldn't remove i scanned my hard drive and then it removed all the curropted folders; and then a Defragmentation will set the order of all folders :)

Hope it will help u :)
0
 

Author Comment

by:Marcos908
Comment Utility
CrazyOne, when i put in quotes c:\Program Files\McAfee VirusScan Professional Edition 7.00 in cmd.exe i get the following message:
"c:\Program Files\Mcafee VirusScan Professional Edition 7.00" is not recognized as an internal or external command,
operable program or batch file.
0
 

Author Comment

by:Marcos908
Comment Utility
HELP PLEASE!!
0
 
LVL 21

Accepted Solution

by:
gemarti earned 63 total points
Comment Utility
I suggest you retry CrazyOne's suggestion:

START | RUN | CMD
CD to your directory.

Use: DIR /X /A   to see the SHORT FILE NAMES of the files and directories there.

use:

RMDIR [/Q] [drive:]path
RD [/Q] [drive:]path

   /S      Removes all directories and files in the specified directory
           in addition to the directory itself.  Used to remove a directory
           tree.

   /Q      Quiet mode, do not ask if ok to remove a directory tree with /S

Example:

RMDIR /Q c:\progra~1\McAfee~1
RD /Q c:\progra~1\McAfee~1

0
 

Author Comment

by:Marcos908
Comment Utility
OH MY GOD!!! THANK YOU VERY MUCH CrazyOne and germarti it has resolved my problem!! :) thank you so very much!
0
 
LVL 21

Expert Comment

by:gemarti
Comment Utility
You are kidding right?

If not...there are Accept buttons that you can press for the correct answers to your problem.

Let's close this thread and move on.
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 21

Expert Comment

by:gemarti
Comment Utility
Thank you.
0
 

Expert Comment

by:PraetorianX3
Comment Utility
Alright this seems to be a common error with XP, I had this problem too. Actually all other solutions from different websites are always the same, like "try it with drag & drob in trashbin". Of cause this crap didn't work. This site was the first who had a answer which is
REALLY WORKING

thanks,you're great
0
 
LVL 4

Expert Comment

by:MFK
Comment Utility
The answer was from CrazyOne!!!!! Marcos908 why did u wait so long to try what had been posted right at the top....be fair.
0
 

Expert Comment

by:dibyadeep
Comment Utility
crazy on your process works on windoze xp too
0
 
LVL 2

Expert Comment

by:db_home
Comment Utility
yeah this works fine but not if the files are like this 15454515.

any sugestions ???
0
 

Expert Comment

by:chrisvanzila
Comment Utility
Great answer CrazyOne.  You were right on the money from the start.  I tried it exactly as you said and it worked.  Pretty sure it was a hacker also.  Good job.
0
 
LVL 10

Expert Comment

by:smegghead
Comment Utility
Just had this problem and tried everything suggested on this page. However, nothing worked.. there were some directories called lpt1, lpt2, lpt3 etc.. then within these there were some others, then com1, com2 etc..  I tried everything, then found a link to the following page on another site..

I must say, it worked a treat. And it's free (for the trimmed down version)

http://www.jrtwine.com/

Look under Delete FXP Files

hope this helps anyone else stumbling upon this page.

Smg.
0
 

Expert Comment

by:mwsw1997
Comment Utility
I had Ftp open on my Server, and someone hacked it to do peer 2 peer file sharing.  they created folders in the inetpub folders with several folders within them.  they also denied me delete permission to them. when i tried to overwrite there permissions it says it can't find the files anywhere.  I was wondering if anyone knows how to delete these.  I tried safe mode. Doesn't work.  It's an exchange server with raid, so i can't take the disks out.  any help would be appreciated. thanks, Mike.
0
 
LVL 3

Expert Comment

by:srappaport
Comment Utility
I had the same problem, mwsw1997.
First, if there are any deletable files inside the folders, delete them.  Then open a cmd prompt and go to your wwwroot folder.
Do a DIR /X /A to get the short folder names of the problem folders. (probably something like 0200~1).
Now type: RD /S 0200~1 (or whatever the folder name is).
Type Y for yes.
If it gives you an error saying that some of the subfolders are protected, REPEAT the same command until you get no errors.  It usually took 3 or 4 repeats to get rid of each folder.
Do this for each problem folder.

Lastly, make sure anonymous access is turned off on your FTP site. ;)

0
 

Expert Comment

by:digital03
Comment Utility
recommend you use Delete FXP Files™ from JRTwine Software.
http://www.jrtwine.com/Products/DelFXPFiles/index.htm

it will delete any file/directory that you need it to... it rocks.
0
 

Expert Comment

by:longitude
Comment Utility
I have a similar problem with a file deletion and get the same message "Cannot delelte file: cannot read from source file or disk"

This file was located in a script folder from the software Maya 6.0 (3d stuff).

Basically i deleted every folder on top of the remaining file until i had only one folder with the file left in it !

the file has no extension and is named: ü&#8359;@&#9562;
And i get the same message on move, delete and rename also !

I already tried all of the above even the file deletion software and still can't remove the file ...

0
 

Expert Comment

by:jwvk
Comment Utility
I had a smilar problem under windows server 2003.
The "Dir /x /a and then RD *dirname*"work perfect.

0
 

Expert Comment

by:benderr2001
Comment Utility
Well, I had a file on my desktop that couldn't be removed by traditional means but I've got to admit that delfxpfiles did the trick (in my case the file was of 0 byte size).

Tiny but finy!
0
 

Expert Comment

by:poopfat
Comment Utility
I had a similar problem with a file downloaded from an email to my desktop. I rightclicked the file, selected open. Since the file had no file association I selected Notepad, got an error message which I dismissed and told it to create a new file. Typed some jibberish in the Notepad window and exited.

The errant file now had a file association and I simply deleted it.
0
 

Expert Comment

by:tamu2003_99
Comment Utility
I had a some files in a folder that I could not delete.  If followed the below instruction from a previous post.  It deleted my folder.  I could not delete the folder because it had two files with out extensions on them!  

I just did the following:  

START | RUN | CMD
CD to your directory.

Use: DIR /X /A   to see the SHORT FILE NAMES of the files and directories there.

use:

RMDIR [/Q] [drive:]path
RD [/Q] [drive:]path

   /S      Removes all directories and files in the specified directory
           in addition to the directory itself.  Used to remove a directory
           tree.

   /Q      Quiet mode, do not ask if ok to remove a directory tree with /S

Example:

RMDIR /Q c:\progra~1\McAfee~1
RD /Q c:\progra~1\McAfee~1


0
 

Expert Comment

by:tamu2003_99
Comment Utility
My question is that I have two files on my desktop that do not have extensions on them that I cannot delete.  What msdos commands do I need to use?  

Thanks, Alan
0
 
LVL 10

Expert Comment

by:smegghead
Comment Utility
Have you tried the suggested software listed above ?? http://www.jrtwine.com/

Delete FXP ??

Smg.
0
 

Expert Comment

by:tamu2003_99
Comment Utility
That program fixed it perfect!!! Thanks! Alan
0
 

Expert Comment

by:SaiJum
Comment Utility
the Delete FXP Files works wonderfully well.
I had a problem deleting files created in the recycler\nprotect folder by "Norton Protected Recycle Bin" which I was unable to delete. Delete FXP Files helped me to delete those files with ease.
Rgds..SaiJum
0
 

Expert Comment

by:barnster123
Comment Utility
I was in a cygwin shell on a windows server and saw this

Amanda> ls -lsa
ls: cannot access  : No such file or directory
total 4
? ???????????  ? ?              ?       ?            ?
0 dr-xr-xr-x+ 10 IUSR_FORESITE  None    0 Dec 12  2006 .
0 drwxr-xr-x+ 20 Administrators None    0 Oct 18 11:31 ..
0 dr-xr-xr-x+  2 IUSR_FORESITE  None    0 Jan 22 11:31 File
0 dr-xr-xr-x+  2 IUSR_FORESITE  None    0 Aug 29  2006 Flash
0 dr-xr-xr-x+  2 IUSR_FORESITE  None    0 Aug 29  2006 Image
0 dr-xr-xr-x+  2 IUSR_FORESITE  None    0 Aug 29  2006 Media
0 drwxr-xr-x+  5 Administrators None    0 Oct  3 11:24 backup
4 -r-xr-xr-x+  1 IUSR_FORESITE  None 2648 Apr  4  2006 space.asp
0 dr-xr-xr-x+  2 IUSR_FORESITE  None    0 May 18  2006 upload
0 drwxr-xr-x+  2 Administrators None    0 Jan 22 11:31 xml


I had to go into command prompt to see the hidden directory.

E:\Inetpub\ssda\UserFiles>DIR /X /A
 Volume in drive E is DATA2
 Volume Serial Number is 5C8B-1561

 Directory of E:\Inetpub\ssda\UserFiles

12/12/2006  04:14 PM    <DIR>                       .
12/12/2006  04:14 PM    <DIR>                       ..
08/14/2006  02:38 PM    <DIR>          0200~1
10/03/2007  10:24 AM    <DIR>                       backup
01/22/2008  11:31 AM    <DIR>                       File
08/29/2006  04:23 PM    <DIR>                       Flash
08/29/2006  04:23 PM    <DIR>                       Image
08/29/2006  04:23 PM    <DIR>                       Media
04/03/2006  11:25 PM             2,648              space.asp
05/18/2006  12:55 PM    <DIR>                       upload
01/22/2008  11:31 AM    <DIR>                       xml
               1 File(s)          2,648 bytes
              10 Dir(s)  64,252,383,232 bytes free

Which i removed with RMDIR 0200~1
What would be the Linux command to list this correctly, or wouldn't the shell cope with the filesystem
0
 
LVL 6

Expert Comment

by:meugen
Comment Utility
I had a similar problem few days ago.
I used sucessfully Unlocker utility( a powerfull freeware app)  and i was able to delete the file with problem.
0
 
LVL 4

Expert Comment

by:dempsedm
Comment Utility
I successfully used the command line stuff listed above:

Use: DIR /X /A   to see the SHORT FILE NAMES of the files and directories there.

use:

RMDIR [/Q] [drive:]path
RD [/Q] [drive:]path

   /S      Removes all directories and files in the specified directory
           in addition to the directory itself.  Used to remove a directory
           tree.

   /Q      Quiet mode, do not ask if ok to remove a directory tree with /S

0
 

Expert Comment

by:private_dustbin
Comment Utility
I had the same kind of issue on a Windows 2003 server and the deletion of the short file name worked.
Thanks guys
0
 

Expert Comment

by:UnityPG
Comment Utility
barnster123,
I had similiar problem and was able to get the foldername with dir /x/a, tried removing with the rmdir, but was unable.  
I took ownership of the folder, then was able to remove it.
0
 
LVL 1

Expert Comment

by:RMFIT
Comment Utility
I was unable to use the solution described above - I was still receiving 'access denied' errors.  I ended up running Process Explorer (procexp.exe) on my server, choosing 'Find' + 'Handle or DLL' and searching for that folder.  Sure enough there were several hung processes accessing that folder.  I killed them and was then able to remove the folder without issue.  
0
 

Expert Comment

by:DoctorInferno
Comment Utility
0
 
LVL 2

Expert Comment

by:patmoli
Comment Utility
GREAT! It Worked for me!
0

Featured Post

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

Are you unable to synchronize your OST (Offline Storage Table) file with Microsoft Exchange Server? Is your OST file exceeding 2 GB size limit? In Microsoft Outlook 2002 and earlier versions, there is a 2 GB size limit for the OST file. If the file …
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now