in Windows Development & Utilities

Hiding Period Files on Windows

Update: 2016-01-14

Files and directories beginning with a period (.) are interpreted as hidden on unix like systems. This is a solution for hiding these files when they appear in the user profile folder on Windows. This is necessary as some software developers fail to set the hidden flag on these on Windows.

Simply create a shortcut in the start-up folder (%appdata%\Microsoft\Windows\Start Menu\Programs\Startup) to:

%COMSPEC% /C "pushd %USERPROFILE% && for /F %a in ( 'dir /B /A ^| findstr /B "\."' ) do attrib +h "%a""

Then change the run option to minimised (found in the shortcut’s properties) and forget about it for the next however long.
Now your .* files and directories will be hidden whenever you login.

You can now ignore all that follows, unless you don’t want to.


I have noticed a distinct need for someone to comment on an easy method of hiding files that start with a period on Windows and finally have found a solution that I myself find acceptable. You may be wondering why someone might need to do this? Being a keen supporter of libre software yet not wanting to relinquish my ability to play games and run commercial software properly I have throughout the years stuck with using Windows for my computing. Most open-source software on Windows is usually a port from Linux aimed source code, this means they usually use periods at the beginning of the name to hide a file or directory, and rarely do they modify that file or directory’s attributes. For me and anyone using a Windows version greater than XP this means the home directory becomes littered with files and folders. You might say that you could just hide them manually but some programmes such as the GIMP regenerate the files after each use and in doing so reset the attributes and revealing the file. So there’s that a justification of the need for my script.

Your thoughts? Click here to comment.

Comment

All fields voluntary.
Comment submission rules apply.