Why is FileInfo showing an extra file extension?

做~自己de王妃 提交于 2019-12-02 16:46:51

问题


I have been having problems with creating a download list of files for a downloader and was getting unexplained "File Does Not Exist" returns. My .avi files were returning found but but .exe and .txt files were getting the not exists.

I have now found by pulling in the whole directory and examining the file contents that my .exe files are showing ".exe.exe". My .txt files are showing ".txt.rtf". Wow, browsing the file directory in Server 2008 only shows a single extension. I don't see an option to display the extension as a column, just the "type". My directory looks like this:

Name           Type
File1.exe      Application
File2.txt      Rich Text Document
File3.avi      AVI File

I had renamed some of these files, maybe I just cannot rename files. I will try using originals ans see if I am ok. Maybe I need to rename the offending files without the displayed extensions. Is this just something weird with the server browser?

Thanks, James


回答1:


Have you checked that "Tools > Folder Options > View > Hide extensions for known file types" is unchecked?

The option should be in (more or less) the same place on Windows Server 2008, I'm answering from home so I only have XP Pro to go on ;)

Obvious I know, but it sometimes is the obvious answer that we overlook.

Just to add - there's no option to show the extension in a separate column.




回答2:


Windows has a "feature" that hides file extensions for known file types. Always turn that off or you'll find yourself creating problems like this.



来源:https://stackoverflow.com/questions/1386338/why-is-fileinfo-showing-an-extra-file-extension

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!