On Windows the user has an option to display/hide file extensions when viewing files. How can I programmatically find the current se开发者_如何学Ctting of this option?
You can find the setting in the registry under
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
It's named HideFileExt
.
Disclaimer: This is an implementation detail of Explorer and you should by no means rely on the fact that location and name of that setting will remain there or not change in future versions of Windows. For a start skim over Raymond Chen's blog The Old New Thing to see how many people wrongly assume that Windows software internals are unchanging and available for their (mis)use. At best don't rely on whatever people set their settings to. It's highly unlikely that this setting will affect any other application than a shell extension.
Please go to Registry Editor to check. Follow the following path:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
Now, double click on HideFileExt on the right side.
In Value data:
Enter 0 to display the file extension.
Enter 1 to hide the file extension.
Source: Here
精彩评论