Advertisement
talama

Reclaim Windows 10

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