Skip to content

Instantly share code, notes, and snippets.

@borisschapira
Created April 10, 2014 07:58
Show Gist options
  • Save borisschapira/10353782 to your computer and use it in GitHub Desktop.
Save borisschapira/10353782 to your computer and use it in GitHub Desktop.
Applying the dot-file convention for hidden files in Windows, for the current folder (no parameter passed) or a specified list of folders (one after another).
@ECHO OFF
IF "%1"=="" GOTO HAVE_0
:Loop
IF "%1"=="" GOTO Continue
set "template=%1\.*"
ECHO."Hiding 'dot directories' in folder %1"
ATTRIB +H /s /d %template%
SHIFT
GOTO Loop
GOTO Continue
:HAVE_0
set "template=%cd%\.*"
ECHO."Hiding 'dot directories' in folder %cd%"
ATTRIB +H /s /d %template%
:Continue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment