Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##########
- # Win10 Initial Setup Script
- # Author: Disassembler <[email protected]>
- # Version: 1.6, 2016-08-07
- ##########
- # source: https://www.dasm.cz/clanek/jak-z-windows-10-udelat-desktopovy-system
- # Ask for elevated permissions if required
- If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
- Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
- Exit
- }
- ##########
- # Privacy Settings
- ##########
- # Disable Telemetry
- Write-Host "Disabling Telemetry..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
- # Enable Telemetry
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
- # Disable Wi-Fi Sense
- Write-Host "Disabling Wi-Fi Sense..."
- If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) {
- New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0
- # Enable Wi-Fi Sense
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1
- # Disable SmartScreen Filter
- #Write-Host "Disabling SmartScreen Filter..."
- #Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "SmartScreenEnabled" -Type String -Value "Off"
- #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation" -Type DWord -Value 0
- # Enable SmartScreen Filter
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "SmartScreenEnabled" -Type String -Value "RequireAdmin"
- Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation"
- # Disable Bing Search in Start Menu
- # Write-Host "Disabling Bing Search in Start Menu..."
- # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0
- # Enable Bing Search in Start Menu
- Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled"
- # Disable Start Menu suggestions
- Write-Host "Disabling Start Menu suggestions..."
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0
- # Enable Start Menu suggestions
- # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 1
- # Disable Location Tracking
- Write-Host "Disabling Location Tracking..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0
- # Enable Location Tracking
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 1
- # Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 1
- # Disable Feedback
- Write-Host "Disabling Feedback..."
- If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) {
- New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Force | Out-Null
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
- # Enable Feedback
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod"
- # Disable Advertising ID
- Write-Host "Disabling Advertising ID..."
- If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo")) {
- New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" | Out-Null
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Type DWord -Value 0
- # Enable Advertising ID
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled"
- # Disable Cortana
- #Write-Host "Disabling Cortana..."
- #If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) {
- # New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Force | Out-Null
- #}
- #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
- #If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) {
- # New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Force | Out-Null}
- #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1
- #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1
- #If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {
- # New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null}
- #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
- # Enable Cortana
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy"
- # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0
- # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts"
- #Enables Cortana to be used as part of your Windows Search Function
- # Write-Output "Re-enabling Cortana to be used in your Windows Search"
- # If ('HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search') {
- # $Search = 'HKLM:\SOFTWARE\Policies\Microsoft\Windows\Windows Search'
- # Set-ItemProperty $Search -Name AllowCortana -Value 1 -Verbose
- # }
- # Restrict Windows Update P2P only to local network
- #Write-Host "Restricting Windows Update P2P only to local network..."
- #Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
- #If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization")) {
- # New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" | Out-Null}
- #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode" -Type DWord -Value 3
- # Unrestrict Windows Update P2P
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode"
- Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode"
- # Remove AutoLogger file and restrict directory
- #Write-Host "Removing AutoLogger file and restricting directory..."
- #$autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
- #If (Test-Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl") {
- # Remove-Item "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl"}
- #icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null
- # Unrestrict AutoLogger directory
- # $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
- # icacls $autoLoggerDir /grant:r SYSTEM:`(OI`)`(CI`)F | Out-Null
- # Stop and disable Diagnostics Tracking Service
- #Write-Host "Stopping and disabling Diagnostics Tracking Service..."
- #Stop-Service "DiagTrack"
- #Set-Service "DiagTrack" -StartupType Disabled
- # Enable and start Diagnostics Tracking Service
- Set-Service "DiagTrack" -StartupType Automatic
- Start-Service "DiagTrack"
- # Stop and disable WAP Push Service
- #Write-Host "Stopping and disabling WAP Push Service..."
- #Stop-Service "dmwappushservice"
- #Set-Service "dmwappushservice" -StartupType Disabled
- # Enable and start WAP Push Service
- # Set-Service "dmwappushservice" -StartupType Automatic
- # Start-Service "dmwappushservice"
- # Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\dmwappushservice" -Name "DelayedAutoStart" -Type DWord -Value 1
- ##########
- # Service Tweaks
- ##########
- # Enable sharing mapped drives between users
- Write-Host "Enabling sharing mapped drives between users..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections" -Type DWord -Value 1
- # Disable sharing mapped drives between users
- # Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections"
- # Disable implicit administrative shares
- Write-Host "Disabling implicit administrative shares..."
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks" -Type DWord -Value 0
- # Enable implicit administrative shares
- # Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks"
- # Disable Firewall
- # Write-Host "Disabling Firewall..."
- # Set-NetFirewallProfile -Profile * -Enabled False
- # Enable Firewall
- # Set-NetFirewallProfile -Profile * -Enabled True
- # Disable Windows Defender
- #Write-Host "Disabling Windows Defender..."
- #Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Type DWord -Value 1
- #Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "WindowsDefender"
- # Enable Windows Defender
- # Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware"
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "WindowsDefender" -Type ExpandString -Value "`"%ProgramFiles%\Windows Defender\MSASCuiL.exe`""
- # Disable offering of Malicious Software Removal Tool through Windows Update
- #Write-Host "Disabling Malicious Software Removal Tool offering..."
- #If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\MRT")) {
- # New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\MRT" | Out-Null
- #}
- #Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\MRT" -Name "DontOfferThroughWUAU" -Type DWord -Value 1
- # Enable offering of Malicious Software Removal Tool through Windows Update
- Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\MRT" -Name "DontOfferThroughWUAU"
- # Disable Windows Update automatic restart
- Write-Host "Disabling Windows Update automatic restart..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 1
- # Enable Windows Update automatic restart
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 0
- # Stop and disable Home Groups services
- Write-Host "Stopping and disabling Home Groups services..."
- Stop-Service "HomeGroupListener"
- Set-Service "HomeGroupListener" -StartupType Disabled
- Stop-Service "HomeGroupProvider"
- Set-Service "HomeGroupProvider" -StartupType Disabled
- # Enable and start Home Groups services
- # Set-Service "HomeGroupListener" -StartupType Manual
- # Set-Service "HomeGroupProvider" -StartupType Manual
- # Start-Service "HomeGroupProvider"
- # Disable Remote Assistance
- #Write-Host "Disabling Remote Assistance..."
- #Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0
- # Enable Remote Assistance
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 1
- # Enable Remote Desktop w/o Network Level Authentication
- Write-Host "Enabling Remote Desktop w/o Network Level Authentication..."
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 0
- Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 0
- # Disable Remote Desktop
- # Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 1
- # Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 1
- ##########
- # UI Tweaks
- ##########
- # Disable Action Center
- Write-Host "Disabling Action Center..."
- If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer")) {
- New-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer" | Out-Null
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -Type DWord -Value 1
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -Type DWord -Value 0
- # Enable Action Center
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter"
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled"
- # Disable Lock screen
- Write-Host "Disabling Lock screen..."
- If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization")) {
- New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" | Out-Null
- }
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -Type DWord -Value 1
- # Enable Lock screen
- # Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen"
- # Disable Autoplay
- Write-Host "Disabling Autoplay..."
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 1
- # Enable Autoplay
- # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 0
- # Disable Autorun for all drives
- #Write-Host "Disabling Autorun for all drives..."
- #If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer")) {
- # New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" | Out-Null
- #}
- #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun" -Type DWord -Value 255
- # Enable Autorun
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun"
- # Disable Sticky keys prompt
- Write-Host "Disabling Sticky keys prompt..."
- Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "506"
- # Enable Sticky keys prompt
- # Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "510"
- # Hide Search button / box
- Write-Host "Hiding Search Box / Button..."
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 0
- # Show Search button / box
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode"
- # Hide Task View button
- Write-Host "Hiding Task View button..."
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 0
- # Show Task View button
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton"
- # Show small icons in taskbar
- #Write-Host "Showing small icons in taskbar..."
- #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons" -Type DWord -Value 1
- # Show large icons in taskbar
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons"
- # Show titles in taskbar
- Write-Host "Showing titles in taskbar..."
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel" -Type DWord -Value 1
- # Hide titles in taskbar
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel"
- # Show all tray icons
- # Write-Host "Showing all tray icons..."
- # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 0
- # Hide tray icons as needed
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray"
- # Show known file extensions
- #Write-Host "Showing known file extensions..."
- #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 0
- # Hide known file extensions
- # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1
- # Show hidden files
- #Write-Host "Showing hidden files..."
- #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 1
- # Hide hidden files
- # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 2
- # Change default Explorer view to This PC
- Write-Host "Changing default Explorer view to This PC..."
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1
- # Change default Explorer view to Quick Access
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo"
- # Show This PC shortcut on desktop
- Write-Host "Showing This PC shortcut on desktop..."
- If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu")) {
- New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" | Out-Null
- }
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Type DWord -Value 0
- Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Type DWord -Value 0
- # Hide This PC shortcut from desktop
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
- # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
- # Remove Desktop icon from This PC
- #Write-Host "Removing Desktop icon from This PC..."
- #Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
- #Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
- # Add Desktop icon to This PC
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
- # Remove Documents icon from This PC
- #Write-Host "Removing Documents icon from This PC..."
- #Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
- #Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
- # Add Documents icon to This PC
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
- # Remove Downloads icon from This PC
- #Write-Host "Removing Downloads icon from This PC..."
- #Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
- #Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
- # Add Downloads icon to This PC
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
- # Remove Music icon from This PC
- Write-Host "Removing Music icon from This PC..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
- # Add Music icon to This PC
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
- # Remove Pictures icon from This PC
- Write-Host "Removing Pictures icon from This PC..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
- # Add Pictures icon to This PC
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
- # Remove Videos icon from This PC
- Write-Host "Removing Videos icon from This PC..."
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
- Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
- # Add Videos icon to This PC
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
- # Add secondary en-US keyboard
- Write-Host "Adding secondary en-US keyboard..."
- $langs = Get-WinUserLanguageList
- $langs.Add("en-US")
- Set-WinUserLanguageList $langs -Force
- # Remove secondary en-US keyboard
- # $langs = Get-WinUserLanguageList
- # Set-WinUserLanguageList ($langs | ? {$_.LanguageTag -ne "en-US"}) -Force
- # Enable NumLock after startup
- Write-Host "Enabling NumLock after startup..."
- If (!(Test-Path "HKU:")) {
- New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
- }
- Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 2147483650
- # Disable NumLock after startup
- # If (!(Test-Path "HKU:")) {
- # New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
- # }
- # Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 2147483648
- ##########
- # Remove unwanted applications
- ##########
- # Disable OneDrive
- #Write-Host "Disabling OneDrive..."
- #If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) {
- # New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null
- #}
- #Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 1
- # Enable OneDrive
- # Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC"
- # Uninstall OneDrive
- Write-Host "Uninstalling OneDrive..."
- Stop-Process -Name OneDrive -ErrorAction SilentlyContinue
- Start-Sleep -s 3
- $onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
- If (!(Test-Path $onedrive)) {
- $onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
- }
- Start-Process $onedrive "/uninstall" -NoNewWindow -Wait
- Start-Sleep -s 3
- Stop-Process -Name explorer -ErrorAction SilentlyContinue
- Start-Sleep -s 3
- Remove-Item "$env:USERPROFILE\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
- Remove-Item "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
- Remove-Item "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
- If (Test-Path "$env:SYSTEMDRIVE\OneDriveTemp") {
- Remove-Item "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse -ErrorAction SilentlyContinue
- }
- If (!(Test-Path "HKCR:")) {
- New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
- }
- Remove-Item -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
- Remove-Item -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
- # Install OneDrive
- # $onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
- # If (!(Test-Path $onedrive)) {
- # $onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
- # }
- # Start-Process $onedrive -NoNewWindow
- # Uninstall default Microsoft applications
- Write-Host "Uninstalling default Microsoft applications..."
- Get-AppxPackage "Microsoft.3DBuilder" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.BingFinance" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.BingNews" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.BingSports" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.BingWeather" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.Getstarted" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.MicrosoftOfficeHub" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.MicrosoftSolitaireCollection" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.Office.OneNote" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.People" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.SkypeApp" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.Windows.Photos" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.WindowsAlarms" -allusers | Remove-AppxPackage
- #Get-AppxPackage "Microsoft.WindowsCamera" | Remove-AppxPackage
- #Get-AppxPackage "microsoft.windowscommunicationsapps" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.WindowsMaps" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.WindowsPhone" -allusers | Remove-AppxPackage
- #Get-AppxPackage "Microsoft.WindowsSoundRecorder" | Remove-AppxPackage
- Get-AppxPackage "Microsoft.ZuneMusic" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.ZuneVideo" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.AppConnector" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.ConnectivityStore" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.Office.Sway" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.Messaging" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.CommsPhone" -allusers | Remove-AppxPackage
- Get-AppxPackage *Twitter* -allusers | Remove-AppxPackage
- Get-AppxPackage *CandyCrush* | Remove-AppxPackage
- Get-AppxPackage *Netflix* | Remove-AppxPackage
- Get-AppxPackage "Drawboard.DrawboardPDF" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.MicrosoftStickyNotes" -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.OneConnect" -allusers | Remove-AppxPackage
- Get-AppxPackage *FarmVille* -allusers | Remove-AppxPackage
- Get-AppxPackage *GAMELOFTSA* | Remove-AppxPackage
- Get-AppxPackage *netflix* -allusers | Remove-AppxPackage
- Get-AppxPackage *radio* -allusers | Remove-AppxPackage
- Get-AppxPackage "Microsoft.XboxApp" -allusers | Remove-AppxPackage
- Get-AppxPackage *acer* -allusers | Remove-AppxPackage
- Get-AppxPackage *drawboard* -allusers | Remove-AppxPackage
- Get-AppxPackage *minecraft* -allusers | Remove-AppxPackage
- Get-AppxPackage *candy* -allusers | Remove-AppxPackage
- Get-AppxPackage *bubble* -allusers | Remove-AppxPackage
- Get-AppxPackage *disney* -allusers | Remove-AppxPackage
- Get-AppxPackage *war* -allusers | Remove-AppxPackage
- Get-AppxPackage *msn* -allusers | Remove-AppxPackage
- Get-AppxPackage *sketch* -allusers | Remove-AppxPackage
- Get-AppxPackage *3d* -allusers | Remove-AppxPackage
- Get-AppxPackage *camer* -allusers | Remove-AppxPackage
- Get-AppxPackage *pdf* -allusers | Remove-AppxPackage
- # Install default Microsoft applications
- Write-Output "Adding Registry key to prevent bloatware apps from returning"
- #Prevents bloatware applications from returning
- $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\Windows\CloudContent"
- If (!(Test-Path $registryPath)) {
- Mkdir $registryPath -ErrorAction SilentlyContinue
- New-ItemProperty $registryPath -Name DisableWindowsConsumerFeatures -Value 1 -Verbose -ErrorAction SilentlyContinue
- }
- Write-Output "Setting Mixed Reality Portal value to 0 so that you can uninstall it in Settings"
- $Holo = 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Holographic'
- If (Test-Path $Holo) {
- Set-ItemProperty $Holo -Name FirstRunSucceeded -Value 0 -Verbose
- }
- # Uninstall Windows Media Player
- #Write-Host "Uninstalling Windows Media Player..."
- #dism /online /Disable-Feature /FeatureName:MediaPlayback /Quiet /NoRestart
- # Install Windows Media Player
- # dism /online /Enable-Feature /FeatureName:MediaPlayback /Quiet /NoRestart
- #Disables People icon on Taskbar
- Write-Output "Disabling People icon on Taskbar"
- $People = 'HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People'
- If (!(Test-Path $People)) {
- mkdir $People -ErrorAction SilentlyContinue
- New-ItemProperty $People -Name PeopleBand -Value 0 -Verbose
- }
- # Uninstall Work Folders Client
- Write-Host "Uninstalling Work Folders Client..."
- dism /online /Disable-Feature /FeatureName:WorkFolders-Client /Quiet /NoRestart
- # Install Work Folders Client
- # dism /online /Enable-Feature /FeatureName:WorkFolders-Client /Quiet /NoRestart
- # Install Linux Subsystem
- # If ([System.Environment]::OSVersion.Version.Build -gt 14315) { # Apply only for build 14316 or newer
- # Write-Host "Installing Linux Subsystem..."
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Type DWord -Value 1
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowAllTrustedApps" -Type DWord -Value 1
- # dism /online /Enable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux /Quiet /NoRestart
- # }
- # Uninstall Linux Subsystem
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Type DWord -Value 0
- # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowAllTrustedApps" -Type DWord -Value 0
- # dism /online /Disable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux /Quiet /NoRestart
- # Set Photo Viewer as default for bmp, gif, jpg and png
- Write-Host "Setting Photo Viewer as default for bmp, gif, jpg, png and tif..."
- If (!(Test-Path "HKCR:")) {
- New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
- }
- ForEach ($type in @("Paint.Picture", "giffile", "jpegfile", "pngfile")) {
- New-Item -Path $("HKCR:\$type\shell\open") -Force | Out-Null
- New-Item -Path $("HKCR:\$type\shell\open\command") | Out-Null
- Set-ItemProperty -Path $("HKCR:\$type\shell\open") -Name "MuiVerb" -Type ExpandString -Value "@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3043"
- Set-ItemProperty -Path $("HKCR:\$type\shell\open\command") -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1"
- }
- # Remove or reset default open action for bmp, gif, jpg and png
- # If (!(Test-Path "HKCR:")) {
- # New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
- # }
- # Remove-Item -Path "HKCR:\Paint.Picture\shell\open" -Recurse
- # Remove-ItemProperty -Path "HKCR:\giffile\shell\open" -Name "MuiVerb"
- # Set-ItemProperty -Path "HKCR:\giffile\shell\open" -Name "CommandId" -Type String -Value "IE.File"
- # Set-ItemProperty -Path "HKCR:\giffile\shell\open\command" -Name "(Default)" -Type String -Value "`"$env:SystemDrive\Program Files\Internet Explorer\iexplore.exe`" %1"
- # Set-ItemProperty -Path "HKCR:\giffile\shell\open\command" -Name "DelegateExecute" -Type String -Value "{17FE9752-0B5A-4665-84CD-569794602F5C}"
- # Remove-Item -Path "HKCR:\jpegfile\shell\open" -Recurse
- # Remove-Item -Path "HKCR:\pngfile\shell\open" -Recurse
- # Show Photo Viewer in "Open with..."
- #Write-Host "Showing Photo Viewer in `"Open with...`""
- #If (!(Test-Path "HKCR:")) {
- # New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
- #}
- #New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\command" -Force | Out-Null
- #New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Force | Out-Null
- #Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open" -Name "MuiVerb" -Type String -Value "@photoviewer.dll,-3043"
- #Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open\command" -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1"
- #Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Name "Clsid" -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
- # Remove Photo Viewer from "Open with..."
- # If (!(Test-Path "HKCR:")) {
- # New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
- # }
- # Remove-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open" -Recurse
- # Enable F8 boot menu options
- Write-Host "Enabling F8 boot menu options..."
- bcdedit /set `{current`} bootmenupolicy Legacy | Out-Null
- # Disable F8 boot menu options
- # bcdedit /set `{current`} bootmenupolicy Standard | Out-Null
- ##########
- # Restart
- ##########
- Write-Host
- Write-Host "Press any key to restart your system..." -ForegroundColor Black -BackgroundColor White
- $key = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
- Write-Host "Restarting..."
- Restart-Computer
Advertisement
Add Comment
Please, Sign In to add comment