Advertisement
dvanek

Win10 default tweak

Mar 18th, 2018
651
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. ##########
  3. # Win10 Initial Setup Script
  4. # Author: Disassembler <disassembler@dasm.cz>
  5. # Version: 1.7, 2016-08-15
  6. # https://www.dasm.cz/clanek/jak-z-windows-10-udelat-desktopovy-system
  7. ##########
  8.  
  9. # Ask for elevated permissions if required
  10. If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
  11.     Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
  12.     Exit
  13. }
  14.  
  15. ##########
  16. # Privacy Settings
  17. ##########
  18.  
  19. # Disable Telemetry
  20. Write-Host "Disabling Telemetry..."
  21. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
  22. Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
  23. Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
  24.  
  25. # Enable Telemetry
  26. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
  27. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
  28. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Policies\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 3
  29.  
  30. # Disable Wi-Fi Sense
  31. Write-Host "Disabling Wi-Fi Sense..."
  32. If (!(Test-Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) {
  33.     New-Item -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null
  34. }
  35. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0
  36. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0
  37.  
  38. # Enable Wi-Fi Sense
  39. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1
  40. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1
  41.  
  42. # Disable SmartScreen Filter
  43. Write-Host "Disabling SmartScreen Filter..."
  44. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "SmartScreenEnabled" -Type String -Value "Off"
  45. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation" -Type DWord -Value 0
  46.  
  47. # Enable SmartScreen Filter
  48. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "SmartScreenEnabled" -Type String -Value "RequireAdmin"
  49. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation"
  50.  
  51. # Disable Bing Search in Start Menu
  52. Write-Host "Disabling Bing Search in Start Menu..."
  53. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0
  54.  
  55. # Enable Bing Search in Start Menu
  56. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled"
  57.  
  58. # Disable Start Menu suggestions
  59. Write-Host "Disabling Start Menu suggestions..."
  60. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 0
  61.  
  62. # Enable Start Menu suggestions
  63. # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" -Name "SystemPaneSuggestionsEnabled" -Type DWord -Value 1
  64.  
  65. # Disable Location Tracking
  66. Write-Host "Disabling Location Tracking..."
  67. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0
  68. Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0
  69.  
  70. # Enable Location Tracking
  71. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 1
  72. # Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 1
  73.  
  74. # Disable Feedback
  75. Write-Host "Disabling Feedback..."
  76. If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules")) {
  77.     New-Item -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Force | Out-Null
  78. }
  79. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
  80.  
  81. # Enable Feedback
  82. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod"
  83.  
  84. # Disable Advertising ID
  85. Write-Host "Disabling Advertising ID..."
  86. If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo")) {
  87.     New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" | Out-Null
  88. }
  89. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Type DWord -Value 0
  90.  
  91. # Enable Advertising ID
  92. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled"
  93.  
  94. # Disable Cortana
  95. Write-Host "Disabling Cortana..."
  96. If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings")) {
  97.     New-Item -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Force | Out-Null
  98. }
  99. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
  100. If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization")) {
  101.     New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Force | Out-Null
  102. }
  103. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1
  104. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1
  105. If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore")) {
  106.     New-Item -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
  107. }
  108. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
  109.  
  110. # Enable Cortana
  111. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy"
  112. # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0
  113. # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0
  114. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts"
  115.  
  116. # Restrict Windows Update P2P only to local network
  117. Write-Host "Restricting Windows Update P2P only to local network..."
  118. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
  119. If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization")) {
  120.     New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" | Out-Null
  121. }
  122. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode" -Type DWord -Value 3
  123.  
  124. # Unrestrict Windows Update P2P
  125. # Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode"
  126. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode"
  127.  
  128. # Remove AutoLogger file and restrict directory
  129. Write-Host "Removing AutoLogger file and restricting directory..."
  130. $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
  131. If (Test-Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl") {
  132.     Remove-Item "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl"
  133. }
  134. icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null
  135.  
  136. # Unrestrict AutoLogger directory
  137. # $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
  138. # icacls $autoLoggerDir /grant:r SYSTEM:`(OI`)`(CI`)F | Out-Null
  139.  
  140. # Stop and disable Diagnostics Tracking Service
  141. Write-Host "Stopping and disabling Diagnostics Tracking Service..."
  142. Stop-Service "DiagTrack"
  143. Set-Service "DiagTrack" -StartupType Disabled
  144.  
  145. # Enable and start Diagnostics Tracking Service
  146. # Set-Service "DiagTrack" -StartupType Automatic
  147. # Start-Service "DiagTrack"
  148.  
  149. # Stop and disable WAP Push Service
  150. Write-Host "Stopping and disabling WAP Push Service..."
  151. Stop-Service "dmwappushservice"
  152. Set-Service "dmwappushservice" -StartupType Disabled
  153.  
  154. # Enable and start WAP Push Service
  155. # Set-Service "dmwappushservice" -StartupType Automatic
  156. # Start-Service "dmwappushservice"
  157. # Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\dmwappushservice" -Name "DelayedAutoStart" -Type DWord -Value 1
  158.  
  159.  
  160.  
  161. ##########
  162. # Service Tweaks
  163. ##########
  164.  
  165. # Lower UAC level
  166. Write-Host "Lowering UAC level..."
  167. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 0
  168. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 0
  169.  
  170. # Raise UAC level
  171. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 5
  172. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 1
  173.  
  174. # Enable sharing mapped drives between users
  175. Write-Host "Enabling sharing mapped drives between users..."
  176. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections" -Type DWord -Value 1
  177.  
  178. # Disable sharing mapped drives between users
  179. # Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections"
  180.  
  181. # Disable implicit administrative shares
  182. Write-Host "Disabling implicit administrative shares..."
  183. Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks" -Type DWord -Value 0
  184.  
  185. # Enable implicit administrative shares
  186. # Remove-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters" -Name "AutoShareWks"
  187.  
  188. # Disable Firewall
  189. Write-Host "Disabling Firewall..."
  190. Set-NetFirewallProfile -Profile * -Enabled False
  191.  
  192. # Enable Firewall
  193. # Set-NetFirewallProfile -Profile * -Enabled True
  194.  
  195. # Disable Windows Defender
  196. Write-Host "Disabling Windows Defender..."
  197. Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Type DWord -Value 1
  198. Remove-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "WindowsDefender" -ErrorAction SilentlyContinue
  199.  
  200. # Enable Windows Defender
  201. # Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware"
  202. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" -Name "WindowsDefender" -Type ExpandString -Value "`"%ProgramFiles%\Windows Defender\MSASCuiL.exe`""
  203.  
  204. # Disable offering of Malicious Software Removal Tool through Windows Update
  205. Write-Host "Disabling Malicious Software Removal Tool offering..."
  206. If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\MRT")) {
  207.     New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\MRT" | Out-Null
  208. }
  209. Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\MRT" -Name "DontOfferThroughWUAU" -Type DWord -Value 1
  210.  
  211. # Enable offering of Malicious Software Removal Tool through Windows Update
  212. # Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\MRT" -Name "DontOfferThroughWUAU"
  213.  
  214. # Disable Windows Update automatic restart
  215. Write-Host "Disabling Windows Update automatic restart..."
  216. Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 1
  217.  
  218. # Enable Windows Update automatic restart
  219. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 0
  220.  
  221. # Stop and disable Home Groups services
  222. Write-Host "Stopping and disabling Home Groups services..."
  223. Stop-Service "HomeGroupListener"
  224. Set-Service "HomeGroupListener" -StartupType Disabled
  225. Stop-Service "HomeGroupProvider"
  226. Set-Service "HomeGroupProvider" -StartupType Disabled
  227.  
  228. # Enable and start Home Groups services
  229. # Set-Service "HomeGroupListener" -StartupType Manual
  230. # Set-Service "HomeGroupProvider" -StartupType Manual
  231. # Start-Service "HomeGroupProvider"
  232.  
  233. # Disable Remote Assistance
  234. Write-Host "Disabling Remote Assistance..."
  235. Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0
  236.  
  237. # Enable Remote Assistance
  238. # Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 1
  239.  
  240. # Enable Remote Desktop w/o Network Level Authentication
  241. Write-Host "Enabling Remote Desktop w/o Network Level Authentication..."
  242. Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 0
  243. Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 0
  244.  
  245. # Disable Remote Desktop
  246. # Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 1
  247. # Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 1
  248.  
  249.  
  250.  
  251. ##########
  252. # UI Tweaks
  253. ##########
  254.  
  255. # Disable Action Center
  256. #Write-Host "Disabling Action Center..."
  257. #If (!(Test-Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer")) {
  258. #   New-Item -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer" | Out-Null
  259. #}
  260. #Set-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -Type DWord -Value 1
  261. #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -Type DWord -Value 0
  262.  
  263. # Enable Action Center
  264. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter"
  265. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled"
  266.  
  267. # Disable Lock screen
  268. #Write-Host "Disabling Lock screen..."
  269. #If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization")) {
  270. #   New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" | Out-Null
  271. #}
  272. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -Type DWord -Value 1
  273.  
  274. # Enable Lock screen
  275. # Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen"
  276.  
  277. # Disable Lock screen (Anniversary Update workaround)
  278. #If ([System.Environment]::OSVersion.Version.Build -gt 14392) { # Apply only for Redstone 1 or newer
  279. #   $service = New-Object -com Schedule.Service
  280. #   $service.Connect()
  281. #   $task = $service.NewTask(0)
  282. #   $task.Settings.DisallowStartIfOnBatteries = $false
  283. #   $trigger = $task.Triggers.Create(9)
  284. #   $trigger = $task.Triggers.Create(11)
  285. #   $trigger.StateChange = 8
  286. #   $action = $task.Actions.Create(0)
  287. #   $action.Path = "reg.exe"
  288. #   $action.Arguments = "add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI\SessionData /t REG_DWORD /v AllowLockScreen /d 0 /f"
  289. #   $service.GetFolder("\").RegisterTaskDefinition("Disable LockScreen", $task, 6, "NT AUTHORITY\SYSTEM", $null, 4) | Out-Null
  290. #}
  291.  
  292. # Enable Lock screen (Anniversary Update workaround)
  293. #If ([System.Environment]::OSVersion.Version.Build -gt 14392) { # Apply only for Redstone 1 or newer
  294. #   Unregister-ScheduledTask -TaskName "Disable LockScreen" -Confirm:$false -ErrorAction SilentlyContinue
  295. #}
  296.  
  297. # Disable Autoplay
  298. Write-Host "Disabling Autoplay..."
  299. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 1
  300.  
  301. # Enable Autoplay
  302. # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 0
  303.  
  304. # Disable Autorun for all drives
  305. Write-Host "Disabling Autorun for all drives..."
  306. If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer")) {
  307.     New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" | Out-Null
  308. }
  309. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun" -Type DWord -Value 255
  310.  
  311. # Enable Autorun
  312. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun"
  313.  
  314. # Disable Sticky keys prompt
  315. Write-Host "Disabling Sticky keys prompt..."
  316. Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "506"
  317.  
  318. # Enable Sticky keys prompt
  319. # Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "510"
  320.  
  321. # Hide Search button / box
  322. #Write-Host "Hiding Search Box / Button..."
  323. #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 0
  324.  
  325. # Show Search button / box
  326. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode"
  327.  
  328. # Hide Task View button
  329. #Write-Host "Hiding Task View button..."
  330. #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 0
  331.  
  332. # Show Task View button
  333. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton"
  334.  
  335. # Show small icons in taskbar
  336. Write-Host "Showing small icons in taskbar..."
  337. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons" -Type DWord -Value 1
  338.  
  339. # Show large icons in taskbar
  340. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons"
  341.  
  342. # Show titles in taskbar
  343. #Write-Host "Showing titles in taskbar..."
  344. #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel" -Type DWord -Value 1
  345.  
  346. # Hide titles in taskbar
  347. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel"
  348.  
  349. # Show all tray icons
  350. #Write-Host "Showing all tray icons..."
  351. #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 0
  352.  
  353. # Hide tray icons as needed
  354. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray"
  355.  
  356. # Show known file extensions
  357. Write-Host "Showing known file extensions..."
  358. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 0
  359.  
  360. # Hide known file extensions
  361. # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1
  362.  
  363. # Show hidden files
  364. Write-Host "Showing hidden files..."
  365. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 1
  366.  
  367. # Hide hidden files
  368. # Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 2
  369.  
  370. # Change default Explorer view to This PC
  371. Write-Host "Changing default Explorer view to This PC..."
  372. Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1
  373.  
  374. # Change default Explorer view to Quick Access
  375. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo"
  376.  
  377. # Show This PC shortcut on desktop
  378. #Write-Host "Showing This PC shortcut on desktop..."
  379. #If (!(Test-Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu")) {
  380. #   New-Item -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" | Out-Null
  381. #}
  382. #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Type DWord -Value 0
  383. #Set-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Type DWord -Value 0
  384.  
  385. # Hide This PC shortcut from desktop
  386. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
  387. # Remove-ItemProperty -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
  388.  
  389. # Remove Desktop icon from This PC
  390. #Write-Host "Removing Desktop icon from This PC..."
  391. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
  392. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
  393.  
  394. # Add Desktop icon to This PC
  395. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
  396. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
  397.  
  398. # Remove Documents icon from This PC
  399. #Write-Host "Removing Documents icon from This PC..."
  400. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
  401. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
  402.  
  403. # Add Documents icon to This PC
  404. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
  405. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{f42ee2d3-909f-4907-8871-4c22fc0bf756}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
  406.  
  407. # Remove Downloads icon from This PC
  408. #Write-Host "Removing Downloads icon from This PC..."
  409. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
  410. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
  411.  
  412. # Add Downloads icon to This PC
  413. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
  414. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{7d83ee9b-2244-4e70-b1f5-5393042af1e4}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
  415.  
  416. # Remove Music icon from This PC
  417. #Write-Host "Removing Music icon from This PC..."
  418. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
  419. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
  420.  
  421. # Add Music icon to This PC
  422. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
  423. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{a0c69a99-21c8-4671-8703-7934162fcf1d}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
  424.  
  425. # Remove Pictures icon from This PC
  426. #Write-Host "Removing Pictures icon from This PC..."
  427. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
  428. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
  429.  
  430. # Add Pictures icon to This PC
  431. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
  432. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{0ddd015d-b06c-45d5-8c4c-f59713854639}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
  433.  
  434. # Remove Videos icon from This PC
  435. #Write-Host "Removing Videos icon from This PC..."
  436. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
  437. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Hide"
  438.  
  439. # Add Videos icon to This PC
  440. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
  441. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Explorer\FolderDescriptions\{35286a68-3c57-41a1-bbb1-0eae73d76c95}\PropertyBag" -Name "ThisPCPolicy" -Type String -Value "Show"
  442.  
  443. # Add secondary en-US keyboard
  444. Write-Host "Adding secondary en-US keyboard..."
  445. $langs = Get-WinUserLanguageList
  446. $langs.Add("en-US")
  447. Set-WinUserLanguageList $langs -Force
  448.  
  449. # Remove secondary en-US keyboard
  450. # $langs = Get-WinUserLanguageList
  451. # Set-WinUserLanguageList ($langs | ? {$_.LanguageTag -ne "en-US"}) -Force
  452.  
  453. # Enable NumLock after startup
  454. Write-Host "Enabling NumLock after startup..."
  455.  If (!(Test-Path "HKU:")) {
  456.     New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
  457.  }
  458. Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 2147483650
  459.  
  460. # Disable NumLock after startup
  461. # If (!(Test-Path "HKU:")) {
  462. #   New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
  463. # }
  464. # Set-ItemProperty -Path "HKU:\.DEFAULT\Control Panel\Keyboard" -Name "InitialKeyboardIndicators" -Type DWord -Value 2147483648
  465.  
  466.  
  467.  
  468. ##########
  469. # Remove unwanted applications
  470. ##########
  471.  
  472. # Disable OneDrive
  473. #Write-Host "Disabling OneDrive..."
  474. #If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) {
  475. #   New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null
  476. #}
  477. #Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 1
  478.  
  479. # Enable OneDrive
  480. # Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC"
  481.  
  482. # Uninstall OneDrive
  483. #Write-Host "Uninstalling OneDrive..."
  484. #Stop-Process -Name OneDrive -ErrorAction SilentlyContinue
  485. #Start-Sleep -s 3
  486. #$onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
  487. #If (!(Test-Path $onedrive)) {
  488. #   $onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
  489. #}
  490. #Start-Process $onedrive "/uninstall" -NoNewWindow -Wait
  491. #Start-Sleep -s 3
  492. #Stop-Process -Name explorer -ErrorAction SilentlyContinue
  493. #Start-Sleep -s 3
  494. #Remove-Item "$env:USERPROFILE\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
  495. #Remove-Item "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
  496. #Remove-Item "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
  497. #If (Test-Path "$env:SYSTEMDRIVE\OneDriveTemp") {
  498. #   Remove-Item "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse -ErrorAction SilentlyContinue
  499. #}
  500. #If (!(Test-Path "HKCR:")) {
  501. #   New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
  502. #}
  503. #Remove-Item -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
  504. #Remove-Item -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
  505.  
  506. # Install OneDrive
  507. # $onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
  508. # If (!(Test-Path $onedrive)) {
  509. #   $onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
  510. # }
  511. # Start-Process $onedrive -NoNewWindow
  512.  
  513. # Uninstall default Microsoft applications
  514. Write-Host "Uninstalling default Microsoft applications..."
  515. Get-AppxPackage "Microsoft.3DBuilder" | Remove-AppxPackage
  516. Get-AppxPackage "Microsoft.BingFinance" | Remove-AppxPackage
  517. Get-AppxPackage "Microsoft.BingNews" | Remove-AppxPackage
  518. Get-AppxPackage "Microsoft.BingSports" | Remove-AppxPackage
  519. Get-AppxPackage "Microsoft.BingWeather" | Remove-AppxPackage
  520. Get-AppxPackage "Microsoft.Getstarted" | Remove-AppxPackage
  521. Get-AppxPackage "Microsoft.MicrosoftOfficeHub" | Remove-AppxPackage
  522. Get-AppxPackage "Microsoft.MicrosoftSolitaireCollection" | Remove-AppxPackage
  523. Get-AppxPackage "Microsoft.Office.OneNote" | Remove-AppxPackage
  524. Get-AppxPackage "Microsoft.People" | Remove-AppxPackage
  525. Get-AppxPackage "Microsoft.SkypeApp" | Remove-AppxPackage
  526. Get-AppxPackage "Microsoft.Windows.Photos" | Remove-AppxPackage
  527. Get-AppxPackage "Microsoft.WindowsAlarms" | Remove-AppxPackage
  528. Get-AppxPackage "Microsoft.WindowsCamera" | Remove-AppxPackage
  529. Get-AppxPackage "microsoft.windowscommunicationsapps" | Remove-AppxPackage
  530. Get-AppxPackage "Microsoft.WindowsMaps" | Remove-AppxPackage
  531. Get-AppxPackage "Microsoft.WindowsPhone" | Remove-AppxPackage
  532. Get-AppxPackage "Microsoft.WindowsSoundRecorder" | Remove-AppxPackage
  533. Get-AppxPackage "Microsoft.XboxApp" | Remove-AppxPackage
  534. Get-AppxPackage "Microsoft.ZuneMusic" | Remove-AppxPackage
  535. Get-AppxPackage "Microsoft.ZuneVideo" | Remove-AppxPackage
  536. Get-AppxPackage "Microsoft.AppConnector" | Remove-AppxPackage
  537. Get-AppxPackage "Microsoft.ConnectivityStore" | Remove-AppxPackage
  538. Get-AppxPackage "Microsoft.Office.Sway" | Remove-AppxPackage
  539. Get-AppxPackage "Microsoft.Messaging" | Remove-AppxPackage
  540. Get-AppxPackage "Microsoft.CommsPhone" | Remove-AppxPackage
  541. Get-AppxPackage "9E2F88E3.Twitter" | Remove-AppxPackage
  542. Get-AppxPackage "king.com.CandyCrushSodaSaga" | Remove-AppxPackage
  543. Get-AppxPackage "4DF9E0F8.Netflix" | Remove-AppxPackage
  544. Get-AppxPackage "Drawboard.DrawboardPDF" | Remove-AppxPackage
  545. Get-AppxPackage "Microsoft.MicrosoftStickyNotes" | Remove-AppxPackage
  546. Get-AppxPackage "Microsoft.OneConnect" | Remove-AppxPackage
  547. Get-AppxPackage "D52A8D61.FarmVille2CountryEscape" | Remove-AppxPackage
  548. Get-AppxPackage "GAMELOFTSA.Asphalt8Airborne" | Remove-AppxPackage
  549. Get-AppxPackage "Microsoft.WindowsFeedbackHub" | Remove-AppxPackage
  550.  
  551. # Install default Microsoft applications
  552. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.3DBuilder").InstallLocation)\AppXManifest.xml"
  553. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingFinance").InstallLocation)\AppXManifest.xml"
  554. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingNews").InstallLocation)\AppXManifest.xml"
  555. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingSports").InstallLocation)\AppXManifest.xml"
  556. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingWeather").InstallLocation)\AppXManifest.xml"
  557. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Getstarted").InstallLocation)\AppXManifest.xml"
  558. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.MicrosoftOfficeHub").InstallLocation)\AppXManifest.xml"
  559. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.MicrosoftSolitaireCollection").InstallLocation)\AppXManifest.xml"
  560. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Office.OneNote").InstallLocation)\AppXManifest.xml"
  561. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.People").InstallLocation)\AppXManifest.xml"
  562. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.SkypeApp").InstallLocation)\AppXManifest.xml"
  563. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Windows.Photos").InstallLocation)\AppXManifest.xml"
  564. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsAlarms").InstallLocation)\AppXManifest.xml"
  565. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsCamera").InstallLocation)\AppXManifest.xml"
  566. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.windowscommunicationsapps").InstallLocation)\AppXManifest.xml"
  567. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsMaps").InstallLocation)\AppXManifest.xml"
  568. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsPhone").InstallLocation)\AppXManifest.xml"
  569. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsSoundRecorder").InstallLocation)\AppXManifest.xml"
  570. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.XboxApp").InstallLocation)\AppXManifest.xml"
  571. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.ZuneMusic").InstallLocation)\AppXManifest.xml"
  572. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.ZuneVideo").InstallLocation)\AppXManifest.xml"
  573. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.AppConnector").InstallLocation)\AppXManifest.xml"
  574. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.ConnectivityStore").InstallLocation)\AppXManifest.xml"
  575. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Office.Sway").InstallLocation)\AppXManifest.xml"
  576. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Messaging").InstallLocation)\AppXManifest.xml"
  577. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.CommsPhone").InstallLocation)\AppXManifest.xml"
  578. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "9E2F88E3.Twitter").InstallLocation)\AppXManifest.xml"
  579. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "king.com.CandyCrushSodaSaga").InstallLocation)\AppXManifest.xml"
  580. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "4DF9E0F8.Netflix").InstallLocation)\AppXManifest.xml"
  581. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Drawboard.DrawboardPDF").InstallLocation)\AppXManifest.xml"
  582. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.MicrosoftStickyNotes").InstallLocation)\AppXManifest.xml"
  583. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.OneConnect").InstallLocation)\AppXManifest.xml"
  584. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "D52A8D61.FarmVille2CountryEscape").InstallLocation)\AppXManifest.xml"
  585. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "GAMELOFTSA.Asphalt8Airborne").InstallLocation)\AppXManifest.xml"
  586. # Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsFeedbackHub").InstallLocation)\AppXManifest.xml"
  587. # In case you have removed them for good, you can try to restore the files using installation medium as follows
  588. # New-Item C:\Mnt -Type Directory | Out-Null
  589. # dism /Mount-Image /ImageFile:D:\sources\install.wim /index:1 /ReadOnly /MountDir:C:\Mnt
  590. # robocopy /S /SEC /R:0 "C:\Mnt\Program Files\WindowsApps" "C:\Program Files\WindowsApps"
  591. # dism /Unmount-Image /Discard /MountDir:C:\Mnt
  592. # Remove-Item -Path C:\Mnt -Recurse
  593.  
  594. # Disable Xbox DVR
  595. If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR")) {
  596.     New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" | Out-Null
  597. }
  598. Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Name "AllowGameDVR" -Type DWord -Value 0
  599.  
  600. # Enable Xbox DVR
  601. #Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\GameDVR" -Name "AllowGameDVR" -ErrorAction SilentlyContinue
  602.  
  603. # Uninstall Windows Media Player
  604. Write-Host "Uninstalling Windows Media Player..."
  605. dism /online /Disable-Feature /FeatureName:MediaPlayback /Quiet /NoRestart
  606.  
  607. # Install Windows Media Player
  608. # dism /online /Enable-Feature /FeatureName:MediaPlayback /Quiet /NoRestart
  609.  
  610. # Uninstall Work Folders Client
  611. Write-Host "Uninstalling Work Folders Client..."
  612. dism /online /Disable-Feature /FeatureName:WorkFolders-Client /Quiet /NoRestart
  613.  
  614. # Install Work Folders Client
  615. # dism /online /Enable-Feature /FeatureName:WorkFolders-Client /Quiet /NoRestart
  616.  
  617. # Install Linux Subsystem
  618.  If ([System.Environment]::OSVersion.Version.Build -gt 14392) { # Apply only for Redstone 1 or newer
  619.     Write-Host "Installing Linux Subsystem..."
  620.     Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Type DWord -Value 1
  621.     Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowAllTrustedApps" -Type DWord -Value 1
  622.     dism /online /Enable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux /Quiet /NoRestart
  623.  }
  624.  
  625. # Uninstall Linux Subsystem
  626. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowDevelopmentWithoutDevLicense" -Type DWord -Value 0
  627. # Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock" -Name "AllowAllTrustedApps" -Type DWord -Value 0
  628. # dism /online /Disable-Feature /FeatureName:Microsoft-Windows-Subsystem-Linux /Quiet /NoRestart
  629.  
  630. # Set Photo Viewer as default for bmp, gif, jpg and png
  631. Write-Host "Setting Photo Viewer as default for bmp, gif, jpg, png and tif..."
  632. If (!(Test-Path "HKCR:")) {
  633.     New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
  634. }
  635. ForEach ($type in @("Paint.Picture", "giffile", "jpegfile", "pngfile")) {
  636.     New-Item -Path $("HKCR:\$type\shell\open") -Force | Out-Null
  637.     New-Item -Path $("HKCR:\$type\shell\open\command") | Out-Null
  638.     Set-ItemProperty -Path $("HKCR:\$type\shell\open") -Name "MuiVerb" -Type ExpandString -Value "@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3043"
  639.     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"
  640. }
  641.  
  642. # Remove or reset default open action for bmp, gif, jpg and png
  643. # If (!(Test-Path "HKCR:")) {
  644. #   New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
  645. # }
  646. # Remove-Item -Path "HKCR:\Paint.Picture\shell\open" -Recurse
  647. # Remove-ItemProperty -Path "HKCR:\giffile\shell\open" -Name "MuiVerb"
  648. # Set-ItemProperty -Path "HKCR:\giffile\shell\open" -Name "CommandId" -Type String -Value "IE.File"
  649. # Set-ItemProperty -Path "HKCR:\giffile\shell\open\command" -Name "(Default)" -Type String -Value "`"$env:SystemDrive\Program Files\Internet Explorer\iexplore.exe`" %1"
  650. # Set-ItemProperty -Path "HKCR:\giffile\shell\open\command" -Name "DelegateExecute" -Type String -Value "{17FE9752-0B5A-4665-84CD-569794602F5C}"
  651. # Remove-Item -Path "HKCR:\jpegfile\shell\open" -Recurse
  652. # Remove-Item -Path "HKCR:\pngfile\shell\open" -Recurse
  653.  
  654. # Show Photo Viewer in "Open with..."
  655. Write-Host "Showing Photo Viewer in `"Open with...`""
  656. If (!(Test-Path "HKCR:")) {
  657.     New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
  658. }
  659. New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\command" -Force | Out-Null
  660. New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Force | Out-Null
  661. Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open" -Name "MuiVerb" -Type String -Value "@photoviewer.dll,-3043"
  662. 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"
  663. Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Name "Clsid" -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
  664.  
  665. # Remove Photo Viewer from "Open with..."
  666. # If (!(Test-Path "HKCR:")) {
  667. #   New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
  668. # }
  669. # Remove-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open" -Recurse
  670.  
  671. # Enable F8 boot menu options
  672. Write-Host "Enabling F8 boot menu options..."
  673. bcdedit /set `{current`} bootmenupolicy Legacy | Out-Null
  674.  
  675. # Disable F8 boot menu options
  676. # bcdedit /set `{current`} bootmenupolicy Standard | Out-Null
  677.  
  678.  
  679.  
  680. ##########
  681. # Restart
  682. ##########
  683. Write-Host
  684. Write-Host "Press any key to restart your system..." -ForegroundColor Black -BackgroundColor White
  685. $key = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
  686. Write-Host "Restarting..."
  687. Restart-Computer
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement