We have several files on a Windows server that show up in directory listings but can't be accessed. I can take ownership of the files, and the ACL shows that Everyone has read/write/execute access; but I can't open the files. chkdsk finds no problems on the volume.
The server is 64-bit Win 2008 R2 Standard SP1.
We had a BSOD recently on this server, and the files were modified shortly before the crash. The crash wasn't in anything filesystem-related, but I'm thinking it corrupted something in kernel memory and that corrupted the filesystem.
Here is some of what I'm seeing when trying to access file "com2.log":
D:\Logs\Application>dir com2*
Volume in drive D is Data
Volume Serial Number is 84D5-FD84
Directory of D:\Logs\Application
09/07/2011 06:57 PM 169,025 com2.log
1 File(s) 169,025 bytes
0 Dir(s) 39,320,612,864 bytes free
D:\Logs\Application>dir com2.log
Directory of \\.
File Not Found
D:\Logs\Application>dir com2.*
Directory of \\.
File Not Found
D:\Logs\Application>cacls com2.log
The filename, directory name, or volume label syntax is incorrect.
D:\Logs\Application>more com2.log
Cannot access file \\.\com2
D:\Logs\Application>more com2*
Cannot access file D:\Logs\Application\com2.log
(cacls doesn't show the ACL, but I can see it in Windows Explorer.)
It seems like it might be a problem with the extension. dir com2*
finds it but dir com2.*
does not.
The file shows up as com2.log in Windows explorer, but when I double-click it, I get this error in Notepad referring to a .txt file extension:
Cannot find the \\.\com2.txt file.
Do you want to create a new file?
Has anyone seen anything like this before? Any suggestions for troubleshooting?
COM2 is a reserved keyword, quite literally for the hardware port COM2 and I'm not sure how that file got there in the first place, since Windows won't let you create a file called
COM2.log
. Try it now, you'll get an error message. For fun, also try creatingLPT1.txt
.According to Naming Files, Paths, and Namespaces, the following are all reserved names and should not be used as file names.
You might try renaming the file either in explorer or using
ren com2.log somethingelse.log
to see if you can manipulate the file then, however I have a feeling that won't work for the same reason you shouldn't be able to create the file in the first place.Failing that, if you follow How to Remove Files with Reserved Names in Windows you should be able to remove the file with the following command. Using the same "fully qualified" path, I imagine you'll also be able to rename the file by using
REN
instead ofDEL
.You might try moving the file:
move com2* com2.log.new
or something of the sort. The filename itself might be messed up.