Skip to content

Instantly share code, notes, and snippets.

@neilpanchal
Created August 4, 2017 22:17
Show Gist options
  • Save neilpanchal/f2d31de0beb4f369bccc6aab630fa278 to your computer and use it in GitHub Desktop.
Save neilpanchal/f2d31de0beb4f369bccc6aab630fa278 to your computer and use it in GitHub Desktop.
7zip Double Click Extract Files
$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