# Clear file association for .PDF files $extension = ".pdf" $progId = "" # Remove the file association Remove-Item "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$extension" -Recurse # Clear the user choice Remove-ItemProperty "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\$extension\UserChoice" -Name ProgId -ErrorAction SilentlyContinue # Set the ProgId to an empty string Set-ItemProperty "HKCU: