Solved Cannot read from the source file or diskIve finally solved a problem thats been bugging me for years. One of our file shares ended up with several undelete able files. Attempting to delete them results in Error Deleting File or Folder Cannot delete file Cannot read from the source file or disk. Note Windows 7s version of this message is something like Could not find this item This is no longer located in C Blah. Verify the items location and try again. Even going to the files properties to check permissions presented a very blank properties dialog. And a CHKDSK didnt sort thing out either. It turns out the problem was the filename ended with a dot, e. C TempStuffSales Agreement. As far as Windows is concerned this is an invalid file name so although it gets reported in a directory listing, the standard Windows APIs for manipulating files subsequently deny its existence. So how did this file get created in the first place The answer a Mac. The file was on a file share which had been accessed by a Mac user. Macs tend to write all sorts of metadata to extra. DSStore files and suchlike and had left this file behind. So if Windows doesnt appear to allow these file names, how did they get to be created Well, it turns out that NTFS allows all sort of file namepath weirdness that Windows, or specifically the Win. September 20. 2008 0738. Jason, and all others who may be running XP with SP3, I found a possible solution as well. From the command prompt, navigate via dos. API, doesnt allow. For example, NTFS actually allows file paths up to 3. K but Windows restricts file paths to no more than 2. MAXPATH. I suppose this is all for DOSWindows 9x backwards compatibility. As these files were being accessed over a file share I guess the usual Win. But thankfully you can get Win. C TempSome. File. C TempSome. File. I discovered after reading this blog post about long paths in. NET. So at a command prompt Start All Programs Accessories Command Prompt I was able to delete the file using del C TempStuffSales Agreement. Note On Windows 7 it seems you can just use wildcards without the trick to delete the offending files e. If its a folderdirectory youre trying to delete use the rd or rmdir command, e. C Documents and SettingsUserDesktopAnnoying Folder. Tip as youre typing the filedirectory name use the TAB key to auto complete the name press TAB repeatedly to cycle through possible names. Of course the corollary of all of this is that you could really annoy somebody by doing this echo Hi USERPROFILEDesktopAnnoying file you cant delete. But you wouldnt do that would you If this post helped you and you feel so inclined, feel free to buy me a beer.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2017
Categories |