Skip to content

Instantly share code, notes, and snippets.

@MahouShoujoMivutilde
Created January 7, 2019 21:49
Show Gist options
  • Save MahouShoujoMivutilde/4428db7faee4e46c6fdb590c078085b7 to your computer and use it in GitHub Desktop.
Save MahouShoujoMivutilde/4428db7faee4e46c6fdb590c078085b7 to your computer and use it in GitHub Desktop.
A script to automatically hide dotfiles (on all drives in all subfolders recursively) on windows machine. Multithreaded.
workflow hideDotfilesOnAllDrives {
function hide($mask) {
$sw = [Diagnostics.Stopwatch]::StartNew()
ATTRIB +H /s /d $mask
$sw.Stop()
echo "$mask - $($sw.Elapsed.TotalSeconds)s"
}
foreach -parallel ($d in get-psdrive -p "FileSystem" | select root) {
hide("$($d.root).*")
}
}
hideDotfilesOnAllDrives
@MahouShoujoMivutilde
Copy link
Author

...It also useful to set this to run automatically in background on idle in task scheduler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment