Archive | June, 2012

PowerShell: Locking Drive Content

This will not hide drive letters but prohibit access to drive content. You need administrative privileges to set this setting. function Hide-DriveContent { param($DriveLetter) $key = @{ Path = ‘HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer’ Name = ‘NoViewOnDrive’ } if ($DriveLetter -eq $null) { Remove-ItemProperty @key } else { $mask = 0 $DriveLetter | ForEach-Object { $_.toUpper()[0] } | Sort-Object […]

Continue Reading →

PowerShell: Hiding Drive Letters

Sometimes you may want to hide drive letters in Windows Explorer from users. There’s a Registry key that can do this for you. It takes a bit mask where each drive has a bit. When the bit is set, the drive is hidden. function Hide-Drive { param($DriveLetter) $key = @{ Path = ‘HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer’ Name = […]

Continue Reading →
revia in alcoholism