Created
August 4, 2017 22:17
-
-
Save neilpanchal/f2d31de0beb4f369bccc6aab630fa278 to your computer and use it in GitHub Desktop.
7zip Double Click Extract Files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$7zInstallationFolder = 'C:\Program Files\7-Zip' | |
$reg = [Microsoft.Win32.RegistryKey]::OpenBaseKey([Microsoft.Win32.RegistryHive]::ClassesRoot, [Microsoft.Win32.RegistryView]::Default) | |
$subKeys = $reg.GetSubKeyNames() | where { $_ -match '7-Zip.' } | |
foreach ($keyName in $subKeys) { | |
$key = $reg.OpenSubKey($keyName + '\shell\open\command', $true) | |
$key.SetValue('', '"' + $7zInstallationFolder + '\7zG.exe" x "%1" -o*') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment