简体   繁体   中英

How to determine if Windows shows file extensions?

On Windows the user has an option to display/hide file extensions when viewing files. How can I programmatically find the current setting 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM