Why is FileInfo showing an extra file extension?

2019-03-06 01:07发布

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

2条回答
姐就是有狂的资本
2楼-- · 2019-03-06 01:15

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.

查看更多
戒情不戒烟
3楼-- · 2019-03-06 01:31

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.

查看更多
登录 后发表回答