Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use xcopy to run a weekly backup of my files to a backup HDD. On the recent backup, it failed on a file with the following error message:

File creation error - The directory or file cannot be created.

Does anyone know what is the cause of this? How to fix it?

The filename which it fails on is:

2009_08_20090811-183728-dmyan@cs_hku_hk-Re_[cgal-discuss]_Using_cgal_in_C-1.eml

The source [path + filename] is 117 characters long. The destination [path + filename] is 81 characters long.

The source disk is formatted to NTFS and the destination disk is FAT32.

share|improve this question

2 Answers 2

Also, for a more robust copier than xcopy, you might want to consider changing to RoboCopy, part of the Windows Server 2003 Resource Kit Tools. It is a Robust Copy that can continue after issues like that and will provide you a neat report. It has a plethora of options that are worth putting some time into reading to ensure you get the most from it and your backups become something you don't have to worry about.

share|improve this answer
    
xcopy can do that already, too. –  Joey Aug 29 '09 at 8:12

Apparently you aren't allowed square brackets in file names, so I don't know how they got there. You could try using fsutil to sort it out http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/fsutil%5Fbehavior.mspx?mfr=true

share|improve this answer
    
I thought this at first too, then plugged in my FAT32 formatted usb stick to test. Square brackets are allowed, the wiki article doesn't make it very clear :\ –  John T Aug 29 '09 at 6:30
    
Just out of curiosity does it copy with explorer, I'm just wondering if it's some weird xcopy issue. Also the suggestion about trying robocopy is a good one. –  Col Aug 29 '09 at 10:47

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.