lupask

Win10 decrapifier

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