From c49853a1cde9ac7b7197b44647780cdc029ea392 Mon Sep 17 00:00:00 2001 From: Richard Newton Date: Sat, 18 Aug 2018 23:41:25 -0700 Subject: [PATCH] Created Stop Edge PDF This contains the code that is in the Stop-EdgePDF function. --- Individual Scripts/Stop Edge PDF | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Individual Scripts/Stop Edge PDF diff --git a/Individual Scripts/Stop Edge PDF b/Individual Scripts/Stop Edge PDF new file mode 100644 index 0000000..3f6abaa --- /dev/null +++ b/Individual Scripts/Stop Edge PDF @@ -0,0 +1,29 @@ +#Stops edge from taking over as the default .PDF viewer + Write-Output "Stopping Edge from taking over as the default .PDF viewer" + $NoPDF = "HKCR:\.pdf" + $NoProgids = "HKCR:\.pdf\OpenWithProgids" + $NoWithList = "HKCR:\.pdf\OpenWithList" + If (!(Get-ItemProperty $NoPDF NoOpenWith)) { + New-ItemProperty $NoPDF NoOpenWith + } + If (!(Get-ItemProperty $NoPDF NoStaticDefaultVerb)) { + New-ItemProperty $NoPDF NoStaticDefaultVerb + } + If (!(Get-ItemProperty $NoProgids NoOpenWith)) { + New-ItemProperty $NoProgids NoOpenWith + } + If (!(Get-ItemProperty $NoProgids NoStaticDefaultVerb)) { + New-ItemProperty $NoProgids NoStaticDefaultVerb + } + If (!(Get-ItemProperty $NoWithList NoOpenWith)) { + New-ItemProperty $NoWithList NoOpenWith + } + If (!(Get-ItemProperty $NoWithList NoStaticDefaultVerb)) { + New-ItemProperty $NoWithList NoStaticDefaultVerb + } + + #Appends an underscore '_' to the Registry key for Edge + $Edge = "HKCR:\AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_" + If (Test-Path $Edge) { + Set-Item $Edge AppXd4nrz8ff68srnhf9t5a8sbjyar1cr723_ + }