Windows file names with space at end

Posted by admin on Jun 18, 2009 in My Notes |

Have a file or directory that you can’t delete because there is a space at the end of the file name? 

If you try and delete from windows you will get the error message
“Error Deleting File or Folder”
“Cannot delete file: Cannot read from the source file or disk.”

To manipulate these files you need to address their absolute path with the prefix of “\\?\”

To do this you need to access these files from the command line. 
Start -> Run -> CMD
del “\\?\c:\dir\filename

Make sure to include the quotes in above command.

For more information see – http://msdn.microsoft.com/en-us/library/aa365247.aspx

Reply

Copyright © 2010 BenMcGrail.com All rights reserved.
Hosted by: VitexOnline.com