How to Hide a Filename

Question: I've heard that there is a delimiter that can be used on filenames that would hide the filename from being viewed. Is this true and if so what delimiter is used?

Answer: There is a 'hidden' attribute available in the properties box of all versions of Windows and Windows NT. To use it you right click on the file and select properties from the bottom of the menu that appears. All you need to do then is click the 'hidden' checkbox at the bottom of the properties list to select it and then select the 'Apply' or 'OK' button.

Setting the 'hidden' attribute in DOS is done using the ATTRIB command. To hide a specific file (let's assume the file is called file.txt for the purpose of this example) you just type in ATTRIB +h file.txt.

Note that this does not hide files on Windows systems when the system has been configured to 'Show all Systems and Hidden Files'.

With Linux there is a delimiter you use on the front of filenames to 'hide' them - that delimiter is the dot character - where you see references to .htaccess and similar for filenames in Linux the dot on the front indicates a hidden file and the actual filename is whatever follows the dot. This can cause problems when working with files intended to be hidden on a Linux web server when working on them on your local Windows computer as you will need to enclose the entire filename within quotes when specifying it as otherwise Windows will misinterpret the dot as the start of the file extension and will complain about the filename missing (where in fact with .htaccess the filename is htaccess and there is no extension).


This article written by Stephen Chapman, Felgall Pty Ltd.

go to top

FaceBook Follow
Twitter Follow