Error: FindFirstFile on backup with file named "aux"


I ran one of my occasional offsite restic backups twice this evening. I got this error on the second run. I don’t know if there was an error on the first run or not as I didn’t look at the console. I know that a lot of data was added to the repository on the first run, so I think it worked ok.

This is with restic 0.9.3 on Windows 10-64.

restic.exe --exclude c:\images\Rejects --exclude c:\images\Prints --exclude “c:\images\Lab Test Prints” --exclude c:\images\Original\200* --exclude c:\images\Original\2010 --exclude c:\images\Original\2011 --exclude c:\images\Original\2012 --exclude c:\images\Original\2013 --exclude c:\images\Original\2014 --exclude c:\images\Original\2015 --exclude c:\images\HomeVideoArchive --repo D:\Restic\Photos backup c:\images

error: FindFirstFile \?\aux: The filename, directory name, or volume label syntax is incorrect.

Files: 0 new, 3 changed, 30157 unmodified
Dirs: 0 new, 1 changed, 0 unmodified
Added to the repo: 595 B

Any thoughts? Is it a problem with my command line, a software bug, some other user error?


Hm, interesting. Can you please run this again with -v -v and paste the lines around that error so we can see which file restic is trying to access? Is there a file called aux in c:\images somewhere?


Yes, there is a file called aux.jpg nested down about four levels. I can’t view, delete, or even look at the properties of this file. So something is screwy on my file system which I need to fix. Sorted - thanks!


Please let us know when you find out what’s going on! File systems are weird sometimes…


The answer is “aux” is a reserved dos keyword, files with that name cause problems. Here’s a reference here.

The format to delete the file named aux.jpg was to run this at an administrator command prompt

del \?\D:\path\to\image\aux.jpg


Oh wow! I had no clue about those restrictions. (Why is Windows the worst? Sorry, can’t help but think that’s… a really sad set of limitations.) Thanks for the link… TIL.


I’m still a bit puzzled. The file is called aux.jpg, which is different from the forbidden name aux. And also, restic’s’ error message talks about \?\aux, without a file extension. How did that happen? :confused:


I don’t have an answer sorry. All I know is I tried multiple methods to delete this file, including “del”, “del” as administrator, the same in OS recovery mode, other commands to change permissions, and nothing worked until I used the ?\ filename format.


Thanks for the feedback, it’s very odd indeed. If anybody can clear that up, I’d be very interested in the cause for that behavior…