Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Try
{
Set-ItemProperty -Path HKLM:\Software\Policies\Microsoft\Windows\System -Name DefaultAssociationsConfiguration -Value '\\Server\Share\AppAssoc.xml'
New-Item -Path HKLM:\Software\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723
Set-ItemProperty -Path HKLM:\Software\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723 -Name NoOpenWith -Value ''
Set-ItemProperty -Path HKLM:\Software\Classes\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723 -Name NoStaticDefaultVerb -Value ''
#DISM Method does not work in 1703.
#Dism.exe /online /Import-DefaultAppAssociations:\\Server\Share\AppAssoc.xml
}
Catch
{
Write-Host "Error Output..." -ForegroundColor Yellow ; `
$Error[0].Exception ; `
$Error[0].InvocationInfo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment