From af14e333297eafbe455ca7b283064d3e71085e6d Mon Sep 17 00:00:00 2001 From: Dmitry Date: Wed, 14 Nov 2018 17:47:37 +0300 Subject: [PATCH] Update Win 10.ps1 --- Win 10.ps1 | 47 +++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/Win 10.ps1 b/Win 10.ps1 index 1ce45213..150f61d7 100644 --- a/Win 10.ps1 +++ b/Win 10.ps1 @@ -1,4 +1,5 @@ -# Службы диагностического отслеживания +[Console]::OutputEncoding = [System.Text.Encoding]::UTF8 +# Службы диагностического отслеживания $services = @( "CDPSvc", "DiagTrack", @@ -259,20 +260,20 @@ New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\ New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1" -Force New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\DropTarget -Name Clsid -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}" -Force # Ассоциация со Средством просмотра фотографий Windows -cmd.exe /c 'ftype Paint.Picture=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1' -cmd.exe /c 'ftype jpegfile=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1' -cmd.exe /c 'ftype pngfile=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1' -cmd.exe /c 'ftype TIFImage.Document=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1' -cmd.exe /c "assoc .bmp=Paint.Picture" -cmd.exe /c "assoc .jpg=jpegfile" -cmd.exe /c "assoc .jpeg=jpegfile" -cmd.exe /c "assoc .png=pngfile" -cmd.exe /c "assoc .tif=TIFImage.Document" -cmd.exe /c "assoc .tiff=TIFImage.Document" -cmd.exe /c "assoc Paint.Picture\DefaultIcon=%SystemRoot%\System32\imageres.dll,-70" -cmd.exe /c "assoc jpegfile\DefaultIcon=%SystemRoot%\System32\imageres.dll,-72" -cmd.exe /c "assoc pngfile\DefaultIcon=%SystemRoot%\System32\imageres.dll,-71" -cmd.exe /c "assoc TIFImage.Document\DefaultIcon=%SystemRoot%\System32\imageres.dll,-122" +cmd.exe /c ftype Paint.Picture=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1 +cmd.exe /c ftype jpegfile=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1 +cmd.exe /c ftype pngfile=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1 +cmd.exe /c ftype TIFImage.Document=%windir%\System32\rundll32.exe "%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll", ImageView_Fullscreen %1 +cmd.exe /c assoc .bmp=Paint.Picture +cmd.exe /c assoc .jpg=jpegfile +cmd.exe /c assoc .jpeg=jpegfile +cmd.exe /c assoc .png=pngfile +cmd.exe /c assoc .tif=TIFImage.Document +cmd.exe /c assoc .tiff=TIFImage.Document +cmd.exe /c assoc Paint.Picture\DefaultIcon=%SystemRoot%\System32\imageres.dll,-70 +cmd.exe /c assoc jpegfile\DefaultIcon=%SystemRoot%\System32\imageres.dll,-72 +cmd.exe /c assoc pngfile\DefaultIcon=%SystemRoot%\System32\imageres.dll,-71 +cmd.exe /c assoc TIFImage.Document\DefaultIcon=%SystemRoot%\System32\imageres.dll,-122 # Удаление OneDrive Stop-Process -Name OneDrive -ErrorAction SilentlyContinue Start-Sleep -s 3 @@ -332,7 +333,19 @@ IF (!(Test-Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization)) } New-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\Windows\DeliveryOptimization -Name DODownloadMode -Value 0 -Force # Включение в Планировщике задач запуска очистки обновлений Windows -New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\Update Cleanup" -Name StateFlags1337 -Value 2 -Force +$keys = @( +"Delivery Optimization Files", +"Device Driver Packages", +"Previous Installations", +"Setup Log Files", +"Temporary Setup Files", +"Update Cleanup", +"Windows Defender", +"Windows Upgrade Log Files") +Foreach ($key in $keys) +{ + New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VolumeCaches\$key" -Name StateFlags1337 -Value 2 -Force +} $action = New-ScheduledTaskAction -Execute "$env:SystemRoot\System32\cleanmgr.exe" -Argument "/sagerun:1337" $trigger = New-ScheduledTaskTrigger -Daily -DaysInterval 90 -At 9am $settings = New-ScheduledTaskSettingsSet -Compatibility Win8 -StartWhenAvailable @@ -599,8 +612,6 @@ Foreach ($key in $keys) { New-ItemProperty -Path Registry::HKEY_CLASSES_ROOT\Drive\shell\$key -Name ProgrammaticAccessOnly -Type String -Value "" -Force } -# Удаление из автозагрузки иконки Защитника Windows -Remove-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run -Name SecurityHealth -Force -ErrorAction SilentlyContinue # Открепить от панели задач Microsoft Edge и Microsoft Store $getstring = @' [DllImport("kernel32.dll", CharSet = CharSet.Auto)]