mirror of
https://github.com/Disassembler0/Win10-Initial-Setup-Script.git
synced 2026-01-12 07:28:29 -05:00
Compare commits
222 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a7d1b3b3b1 | ||
|
|
0d1e8faf61 | ||
|
|
03d47362e0 | ||
|
|
f53ec4001a | ||
|
|
ccb7fa1b77 | ||
|
|
af751acb7f | ||
|
|
b0de075d46 | ||
|
|
f2b628048c | ||
|
|
7feaf667a8 | ||
|
|
a9c9bbb6f0 | ||
|
|
f42acded36 | ||
|
|
984e370fe6 | ||
|
|
3ecf486524 | ||
|
|
84b75b1a86 | ||
|
|
37b19b942a | ||
|
|
5565b31afb | ||
|
|
f64365bdcb | ||
|
|
96b5267c1f | ||
|
|
96da78d043 | ||
|
|
2c741b2c40 | ||
|
|
5f452a171a | ||
|
|
8ff24e54f1 | ||
|
|
aa4d3d58a4 | ||
|
|
a7f2b7b7c5 | ||
|
|
c747faa96a | ||
|
|
bce7bbc109 | ||
|
|
e2646d13e4 | ||
|
|
c5c107c59f | ||
|
|
2c235573c5 | ||
|
|
113055beaa | ||
|
|
22c2c047f1 | ||
|
|
a670106295 | ||
|
|
a68bb170a4 | ||
|
|
5fae7389e1 | ||
|
|
1e977ab95f | ||
|
|
1acc37a099 | ||
|
|
3b8fc957c1 | ||
|
|
d19e243a05 | ||
|
|
c540b0e7ed | ||
|
|
191e820100 | ||
|
|
66953faeb6 | ||
|
|
70aee80559 | ||
|
|
8dfe56cf2e | ||
|
|
4c81d1cff2 | ||
|
|
9e6c3d6ed4 | ||
|
|
33d4a18633 | ||
|
|
fb91d9df66 | ||
|
|
80e9c04861 | ||
|
|
22fb376831 | ||
|
|
3c9d6ea092 | ||
|
|
ab4e763fc1 | ||
|
|
ae9998fd4a | ||
|
|
7c869b377c | ||
|
|
7313970f86 | ||
|
|
c5cb2556a8 | ||
|
|
d354c414b6 | ||
|
|
44bb2b92dd | ||
|
|
ca8c6c6859 | ||
|
|
1f1412f68d | ||
|
|
e3af426cb5 | ||
|
|
fee2f345e9 | ||
|
|
f8727c682c | ||
|
|
29a22a253c | ||
|
|
7e39e3966f | ||
|
|
f3b74a6504 | ||
|
|
b6205f65fc | ||
|
|
c4a3e1a5c1 | ||
|
|
43f70e46a6 | ||
|
|
603f5a74fe | ||
|
|
b5eb8e42c1 | ||
|
|
94b8a92278 | ||
|
|
f66f0d0bb4 | ||
|
|
b44f65dc60 | ||
|
|
9decdac904 | ||
|
|
db20580134 | ||
|
|
2f33a2a17a | ||
|
|
fe299da41e | ||
|
|
488baa111f | ||
|
|
5fa6f4409c | ||
|
|
88cac9efa8 | ||
|
|
4ef4163172 | ||
|
|
8d0ad4c9c8 | ||
|
|
f152b727ed | ||
|
|
98e106b78a | ||
|
|
d4fe0001a9 | ||
|
|
03e501b481 | ||
|
|
2c79e6fb1f | ||
|
|
bf97bb5f7b | ||
|
|
3e16baf9fa | ||
|
|
39ff492b70 | ||
|
|
793e98af93 | ||
|
|
9f755fab3d | ||
|
|
eb82e5b855 | ||
|
|
749150e9e2 | ||
|
|
4b8a519ee0 | ||
|
|
12b6cef3d1 | ||
|
|
657d353cab | ||
|
|
fea6de8104 | ||
|
|
7b3398fdd7 | ||
|
|
7b653187a4 | ||
|
|
9332fd4e7b | ||
|
|
cf5af8ab17 | ||
|
|
dc0a121435 | ||
|
|
1ab60c363e | ||
|
|
575b7ef26a | ||
|
|
7be6666d1d | ||
|
|
4df2b8cc44 | ||
|
|
9dcbd908f4 | ||
|
|
cf870330c8 | ||
|
|
3bdb745e0f | ||
|
|
5fe7d91b79 | ||
|
|
615ff8cacc | ||
|
|
42fde5e945 | ||
|
|
e3570d5f28 | ||
|
|
7de3e81c79 | ||
|
|
a41c0eea7b | ||
|
|
ccc65c4ad3 | ||
|
|
17a5c51e66 | ||
|
|
1eaa9d58bd | ||
|
|
e24132e074 | ||
|
|
04b85dac57 | ||
|
|
18e75afef6 | ||
|
|
46f3881d2b | ||
|
|
b67276058b | ||
|
|
8d468e7df1 | ||
|
|
ebaa3d0ba7 | ||
|
|
e9b915a2da | ||
|
|
3e1c7feeb6 | ||
|
|
491be4acc2 | ||
|
|
538a1fdd39 | ||
|
|
50362f37e1 | ||
|
|
871cad8660 | ||
|
|
5eb8a84dce | ||
|
|
d93d5ac4df | ||
|
|
b6840e2ba2 | ||
|
|
6830298064 | ||
|
|
39a1d9022d | ||
|
|
3f9e7e84a1 | ||
|
|
59b2000f6c | ||
|
|
b1447c0fc9 | ||
|
|
c79ed38b66 | ||
|
|
c935abafa3 | ||
|
|
14bf1e8477 | ||
|
|
2f8e43cc03 | ||
|
|
e0c9dd1df7 | ||
|
|
157bf356dc | ||
|
|
d1089630c5 | ||
|
|
936e0da7ec | ||
|
|
71b8166b9e | ||
|
|
23f19fd851 | ||
|
|
9c957d217c | ||
|
|
90deb26b55 | ||
|
|
dac835801a | ||
|
|
ad09c6ec67 | ||
|
|
11dd5c64e5 | ||
|
|
1f67aedeab | ||
|
|
94216899a5 | ||
|
|
d427ae7354 | ||
|
|
8b88e2deeb | ||
|
|
3fa306ac8f | ||
|
|
61763b3c63 | ||
|
|
58ff7a00d1 | ||
|
|
727bf0d09b | ||
|
|
70033c0a11 | ||
|
|
ef8e0074c4 | ||
|
|
2e93e01aa1 | ||
|
|
9da73e107a | ||
|
|
db90cefd5b | ||
|
|
303eaf737f | ||
|
|
f5d849a32d | ||
|
|
8169e550ea | ||
|
|
fcae96daa4 | ||
|
|
2f20cacfdf | ||
|
|
4d419b722b | ||
|
|
4085887741 | ||
|
|
2fd170080e | ||
|
|
f870886df7 | ||
|
|
4167b3b6be | ||
|
|
a2e9fede9f | ||
|
|
ed1524589b | ||
|
|
8f599210e3 | ||
|
|
1fe7cad283 | ||
|
|
90399bdd07 | ||
|
|
3bc4e67d00 | ||
|
|
b31bfe5ee8 | ||
|
|
5cfec604ef | ||
|
|
56845c817b | ||
|
|
7934a1ad75 | ||
|
|
770059d362 | ||
|
|
7fa9d1a1e5 | ||
|
|
4332b46084 | ||
|
|
320590c2d5 | ||
|
|
1136c0b390 | ||
|
|
d163d09a22 | ||
|
|
e62abd0cfc | ||
|
|
12064cd8be | ||
|
|
83cda95ddf | ||
|
|
a7f3ced7e4 | ||
|
|
65a27e5ca1 | ||
|
|
428b94a367 | ||
|
|
c0a3de5938 | ||
|
|
f89ba71646 | ||
|
|
e1b8c5ca8b | ||
|
|
ca84acf781 | ||
|
|
a7afe5aabe | ||
|
|
12cd8c522d | ||
|
|
60c9237983 | ||
|
|
6cdfc3292d | ||
|
|
d5bb4a6782 | ||
|
|
7df79cac16 | ||
|
|
f3afde4551 | ||
|
|
db7356151c | ||
|
|
e12cb11a0c | ||
|
|
7d2ff6c103 | ||
|
|
cda81118fd | ||
|
|
480788a251 | ||
|
|
c55d256c3a | ||
|
|
83c13edca2 | ||
|
|
ea25c9950c | ||
|
|
f444709b3e | ||
|
|
f65ad6fbaf | ||
|
|
f118078813 |
1
Default.cmd
Normal file
1
Default.cmd
Normal file
@@ -0,0 +1 @@
|
||||
@powershell.exe -NoProfile -ExecutionPolicy Bypass -File "%~dp0Win10.ps1" -include "%~dp0Win10.psm1" -preset "%~dpn0.preset"
|
||||
183
Default.preset
Normal file
183
Default.preset
Normal file
@@ -0,0 +1,183 @@
|
||||
##########
|
||||
# Win10 / WinServer2016 Initial Setup Script - Default preset
|
||||
# Author: Disassembler <disassembler@dasm.cz>
|
||||
# Version: v3.1, 2018-10-04
|
||||
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
|
||||
##########
|
||||
|
||||
### Require administrator privileges ###
|
||||
RequireAdmin
|
||||
|
||||
### Privacy Tweaks ###
|
||||
DisableTelemetry # EnableTelemetry
|
||||
DisableWiFiSense # EnableWiFiSense
|
||||
# DisableSmartScreen # EnableSmartScreen
|
||||
DisableWebSearch # EnableWebSearch
|
||||
DisableAppSuggestions # EnableAppSuggestions
|
||||
DisableActivityHistory # EnableActivityHistory
|
||||
DisableBackgroundApps # EnableBackgroundApps
|
||||
DisableLocationTracking # EnableLocationTracking
|
||||
DisableMapUpdates # EnableMapUpdates
|
||||
DisableFeedback # EnableFeedback
|
||||
DisableTailoredExperiences # EnableTailoredExperiences
|
||||
DisableAdvertisingID # EnableAdvertisingID
|
||||
DisableWebLangList # EnableWebLangList
|
||||
DisableCortana # EnableCortana
|
||||
DisableErrorReporting # EnableErrorReporting
|
||||
# SetP2PUpdateLocal # SetP2PUpdateInternet # SetP2PUpdateDisable
|
||||
DisableDiagTrack # EnableDiagTrack
|
||||
DisableWAPPush # EnableWAPPush
|
||||
# HideRecentJumplists # ShowRecentJumplists
|
||||
|
||||
### Security Tweaks ###
|
||||
# SetUACLow # SetUACHigh
|
||||
# EnableSharingMappedDrives # DisableSharingMappedDrives
|
||||
DisableAdminShares # EnableAdminShares
|
||||
# DisableSMB1 # EnableSMB1
|
||||
# DisableSMBServer # EnableSMBServer
|
||||
# DisableLLMNR # EnableLLMNR
|
||||
# DisableNCSIProbe # EnableNCSIProbe
|
||||
SetCurrentNetworkPrivate # SetCurrentNetworkPublic
|
||||
# SetUnknownNetworksPrivate # SetUnknownNetworksPublic
|
||||
# DisableNetDevicesAutoInst # EnableNetDevicesAutoInst
|
||||
# DisableFirewall # EnableFirewall
|
||||
# DisableDefender # EnableDefender
|
||||
# DisableDefenderCloud # EnableDefenderCloud
|
||||
# EnableCtrldFolderAccess # DisableCtrldFolderAccess
|
||||
# EnableCIMemoryIntegrity # DisableCIMemoryIntegrity
|
||||
# EnableDefenderAppGuard # DisableDefenderAppGuard
|
||||
HideAccountProtectionWarn # ShowAccountProtectionWarn
|
||||
# DisableDownloadBlocking # EnableDownloadBlocking
|
||||
DisableScriptHost # EnableScriptHost
|
||||
EnableDotNetStrongCrypto # DisableDotNetStrongCrypto
|
||||
# EnableMeltdownCompatFlag # DisableMeltdownCompatFlag
|
||||
EnableF8BootMenu # DisableF8BootMenu
|
||||
# DisableBootRecovery # EnableBootRecovery
|
||||
# DisableRecoveryAndReset # EnableRecoveryAndReset
|
||||
SetDEPOptOut # SetDEPOptIn
|
||||
|
||||
### Service Tweaks ###
|
||||
# DisableUpdateMSRT # EnableUpdateMSRT
|
||||
# DisableUpdateDriver # EnableUpdateDriver
|
||||
DisableUpdateRestart # EnableUpdateRestart
|
||||
# DisableHomeGroups # EnableHomeGroups
|
||||
DisableSharedExperiences # EnableSharedExperiences
|
||||
DisableRemoteAssistance # EnableRemoteAssistance
|
||||
EnableRemoteDesktop # DisableRemoteDesktop
|
||||
DisableAutoplay # EnableAutoplay
|
||||
DisableAutorun # EnableAutorun
|
||||
# DisableRestorePoints # EnableRestorePoints
|
||||
# EnableStorageSense # DisableStorageSense
|
||||
# DisableDefragmentation # EnableDefragmentation
|
||||
# DisableSuperfetch # EnableSuperfetch
|
||||
# DisableIndexing # EnableIndexing
|
||||
# DisableNTFSLastAccess # EnableNTFSLastAccess
|
||||
# SetBIOSTimeUTC # SetBIOSTimeLocal
|
||||
# EnableHibernation # DisableHibernation
|
||||
# DisableSleepButton # EnableSleepButton
|
||||
# DisableSleepTimeout # EnableSleepTimeout
|
||||
# DisableFastStartup # EnableFastStartup
|
||||
# DisableAutoRebootOnCrash # EnableAutoRebootOnCrash
|
||||
|
||||
### UI Tweaks ###
|
||||
DisableActionCenter # EnableActionCenter
|
||||
DisableLockScreen # EnableLockScreen
|
||||
# DisableLockScreenRS1 # EnableLockScreenRS1
|
||||
HideNetworkFromLockScreen # ShowNetworkOnLockScreen
|
||||
HideShutdownFromLockScreen # ShowShutdownOnLockScreen
|
||||
# DisableAeroShake # EnableAeroShake
|
||||
DisableStickyKeys # EnableStickyKeys
|
||||
ShowTaskManagerDetails # HideTaskManagerDetails
|
||||
ShowFileOperationsDetails # HideFileOperationsDetails
|
||||
# EnableFileDeleteConfirm # DisableFileDeleteConfirm
|
||||
HideTaskbarSearch # ShowTaskbarSearchIcon # ShowTaskbarSearchBox
|
||||
HideTaskView # ShowTaskView
|
||||
ShowSmallTaskbarIcons # ShowLargeTaskbarIcons
|
||||
SetTaskbarCombineWhenFull # SetTaskbarCombineNever # SetTaskbarCombineAlways
|
||||
HideTaskbarPeopleIcon # ShowTaskbarPeopleIcon
|
||||
ShowTrayIcons # HideTrayIcons
|
||||
DisableSearchAppInStore # EnableSearchAppInStore
|
||||
DisableNewAppPrompt # EnableNewAppPrompt
|
||||
# HideRecentlyAddedApps # ShowRecentlyAddedApps
|
||||
# SetControlPanelSmallIcons # SetControlPanelLargeIcons # SetControlPanelCategories
|
||||
DisableShortcutInName # EnableShortcutInName
|
||||
SetVisualFXPerformance # SetVisualFXAppearance
|
||||
# AddENKeyboard # RemoveENKeyboard
|
||||
# EnableNumlock # DisableNumlock
|
||||
# SetSoundSchemeNone # SetSoundSchemeDefault
|
||||
# DisableStartupSound # EnableStartupSound
|
||||
# DisableChangingSoundScheme # EnableChangingSoundScheme
|
||||
|
||||
### Explorer UI Tweaks ###
|
||||
ShowKnownExtensions # HideKnownExtensions
|
||||
ShowHiddenFiles # HideHiddenFiles
|
||||
EnableNavPaneExpand # DisableNavPaneExpand
|
||||
# EnableFldrSeparateProcess # DisableFldrSeparateProcess
|
||||
# EnableRestoreFldrWindows # DisableRestoreFldrWindows
|
||||
# DisableSharingWizard # EnableSharingWizard
|
||||
# HideSelectCheckboxes # ShowSelectCheckboxes
|
||||
HideSyncNotifications # ShowSyncNotifications
|
||||
HideRecentShortcuts # ShowRecentShortcuts
|
||||
SetExplorerThisPC # SetExplorerQuickAccess
|
||||
HideQuickAccess # ShowQuickAccess
|
||||
ShowThisPCOnDesktop # HideThisPCFromDesktop
|
||||
# ShowUserFolderOnDesktop # HideUserFolderFromDesktop
|
||||
HideDesktopFromThisPC # ShowDesktopInThisPC
|
||||
# HideDesktopFromExplorer # ShowDesktopInExplorer
|
||||
HideDocumentsFromThisPC # ShowDocumentsInThisPC
|
||||
# HideDocumentsFromExplorer # ShowDocumentsInExplorer
|
||||
HideDownloadsFromThisPC # ShowDownloadsInThisPC
|
||||
# HideDownloadsFromExplorer # ShowDownloadsInExplorer
|
||||
HideMusicFromThisPC # ShowMusicInThisPC
|
||||
# HideMusicFromExplorer # ShowMusicInExplorer
|
||||
HidePicturesFromThisPC # ShowPicturesInThisPC
|
||||
# HidePicturesFromExplorer # ShowPicturesInExplorer
|
||||
HideVideosFromThisPC # ShowVideosInThisPC
|
||||
# HideVideosFromExplorer # ShowVideosInExplorer
|
||||
Hide3DObjectsFromThisPC # Show3DObjectsInThisPC
|
||||
# Hide3DObjectsFromExplorer # Show3DObjectsInExplorer
|
||||
# HideIncludeInLibraryMenu # ShowIncludeInLibraryMenu
|
||||
# HideGiveAccessToMenu # ShowGiveAccessToMenu
|
||||
# HideShareMenu # ShowShareMenu
|
||||
# DisableThumbnails # EnableThumbnails
|
||||
DisableThumbnailCache # EnableThumbnailCache
|
||||
DisableThumbsDBOnNetwork # EnableThumbsDBOnNetwork
|
||||
|
||||
### Application Tweaks ###
|
||||
DisableOneDrive # EnableOneDrive
|
||||
UninstallOneDrive # InstallOneDrive
|
||||
UninstallMsftBloat # InstallMsftBloat
|
||||
UninstallThirdPartyBloat # InstallThirdPartyBloat
|
||||
# UninstallWindowsStore # InstallWindowsStore
|
||||
DisableXboxFeatures # EnableXboxFeatures
|
||||
DisableAdobeFlash # EnableAdobeFlash
|
||||
DisableEdgeShortcutCreation # EnableEdgeShortcutCreation
|
||||
# UninstallMediaPlayer # InstallMediaPlayer
|
||||
# UninstallInternetExplorer # InstallInternetExplorer
|
||||
# UninstallWorkFolders # InstallWorkFolders
|
||||
# UninstallPowerShellV2 # InstallPowerShellV2
|
||||
# InstallLinuxSubsystem # UninstallLinuxSubsystem
|
||||
# InstallHyperV # UninstallHyperV
|
||||
# InstallNET23 # UninstallNET23
|
||||
SetPhotoViewerAssociation # UnsetPhotoViewerAssociation
|
||||
AddPhotoViewerOpenWith # RemovePhotoViewerOpenWith
|
||||
# UninstallPDFPrinter # InstallPDFPrinter
|
||||
UninstallXPSPrinter # InstallXPSPrinter
|
||||
RemoveFaxPrinter # AddFaxPrinter
|
||||
# UninstallFaxAndScan # InstallFaxAndScan
|
||||
|
||||
### Server Specific Tweaks ###
|
||||
# HideServerManagerOnLogin # ShowServerManagerOnLogin
|
||||
# DisableShutdownTracker # EnableShutdownTracker
|
||||
# DisablePasswordPolicy # EnablePasswordPolicy
|
||||
# DisableCtrlAltDelLogin # EnableCtrlAltDelLogin
|
||||
# DisableIEEnhancedSecurity # EnableIEEnhancedSecurity
|
||||
# EnableAudio # DisableAudio
|
||||
|
||||
### Unpinning ###
|
||||
# UnpinStartMenuTiles
|
||||
# UnpinTaskbarIcons
|
||||
|
||||
### Auxiliary Functions ###
|
||||
WaitForKey
|
||||
Restart
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Disassembler <disassembler@dasm.cz>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
268
README.md
Normal file
268
README.md
Normal file
@@ -0,0 +1,268 @@
|
||||
## Contents
|
||||
- [Description](#description)
|
||||
- [Usage](#usage)
|
||||
- [FAQ](#faq)
|
||||
- [Windows builds overview](#windows-builds-overview)
|
||||
- [Advanced usage](#advanced-usage)
|
||||
- [Maintaining own forks](#maintaining-own-forks)
|
||||
- [Contribution guidelines](#contribution-guidelines)
|
||||
|
||||
|
||||
|
||||
## Description
|
||||
|
||||
This is a PowerShell script for automation of routine tasks done after fresh installations of Windows 10 and Windows Server 2016. This is by no means any complete set of all existing Windows tweaks and neither is it another "antispying" type of script. It's simply a setting which I like to use and which in my opinion make the system less obtrusive.
|
||||
|
||||
|
||||
|
||||
## Usage
|
||||
If you just want to run the script with the default preset, download and unpack the [latest release](https://github.com/Disassembler0/Win10-Initial-Setup-Script/releases) and then simply double-click on the *Default.cmd* file and confirm *User Account Control* prompt. Make sure your account is a member of *Administrators* group as the script attempts to run with elevated privileges.
|
||||
|
||||
The script supports command line options and parameters which can help you customize the tweak selection or even add your own custom tweaks, however these features require some basic knowledge of command line usage and PowerShell scripting. Refer to [Advanced usage](#advanced-usage) section for more details.
|
||||
|
||||
|
||||
|
||||
## FAQ
|
||||
|
||||
**Q:** Can I run the script safely?
|
||||
**A:** Definitely not. You have to understand what the functions do and what will be the implications for you if you run them. Some functions lower security, hide controls or uninstall applications. **If you're not sure what the script does, do not attempt to run it!**
|
||||
|
||||
**Q:** Can I run the script repeatedly?
|
||||
**A:** Yes! In fact the script has been written to support exactly that, as it's not uncommon that big Windows Updates reset some of the settings.
|
||||
|
||||
**Q:** Which versions and editions of Windows are supported?
|
||||
**A:** The script aims to be fully compatible with the most up-to-date 64bit version of Windows 10 receiving updates from semi-annual channel, however if you create your own preset and exclude the incompatible tweaks, it will work also on LTSB/LTSC and possibly also on 32bit systems. Vast majority of the tweaks will work on all Windows editions. Some of them rely on group policy settings, so there may be a few limitations for Home and Education editions.
|
||||
|
||||
**Q:** Can I run the script on Windows Server 2016?
|
||||
**A:** Yes. Starting from version 2.5, Windows Server 2016 is supported. There are even few tweaks specific to Server environment. Keep in mind though, that the script is still primarily designed for Windows 10, so you have to create your own preset for Windows Server 2016.
|
||||
|
||||
**Q:** Can I run the script on Windows 7, 8, 8.1 or other versions of Windows?
|
||||
**A:** No. Although some tweaks may work also on older versions of Windows, the script is developed only for Windows 10 and Windows Server 2016. There are no plans to support older versions.
|
||||
|
||||
**Q:** Can I run the script in multi-user environment?
|
||||
**A:** Yes, to certain extent. Some tweaks (most notably UI tweaks) are set only for the user currently executing the script. As stated above, the script can be run repeatedly; therefore it's possible to run it multiple times, each time as different user. Due to the nature of authentication and privilege escalation mechanisms in Windows, most of the tweaks can be successfully applied only by users belonging to *Administrators* group. Standard users will get an UAC prompt asking for admin credentials which then causes the tweaks to be applied to the given admin account instead of the original non-privileged one. There are a few ways how this can be circumvented programmatically, but I'm not planning to include any as it would negatively impact code complexity and readability. If you still wish to try to use the script in multi-user environment, check [this answer in issue #29](https://github.com/Disassembler0/Win10-Initial-Setup-Script/issues/29#issuecomment-333040591) for some pointers.
|
||||
|
||||
**Q:** Did you test the script?
|
||||
**A:** Yes. I'm testing new additions on up-to-date 64bit Home and Enterprise editions in VMs. I'm also regularly using it for all my home installations after all bigger updates.
|
||||
|
||||
**Q**: I've run the script and it did something I don't like, how can I undo it?
|
||||
**A:** For every tweak, there is also a corresponding function which restores the default settings. The default is considered freshly installed Windows 10 or Windows Server 2016 with no adjustments made during or after the installation. Use the tweaks to create and run new preset. Alternatively, since some functions are just automation for actions which can be done using GUI, find appropriate control and modify it manually.
|
||||
|
||||
**Q:** I've run the script and some controls are now greyed out and display message "*Some settings are hidden or managed by your organization*", why?
|
||||
**A:** To ensure that system-wide tweaks are applied smoothly and reliably, some of them make use of *Group Policy Objects* (*GPO*). The same mechanism is employed also in companies managing their computers in large scale, so the users without administrative privileges can't change the settings. If you wish to change a setting locked by GPO, apply the appropriate restore tweak and the control will become available again.
|
||||
|
||||
**Q:** I've run the script and it broke my computer / killed neighbor's dog / caused world war 3.
|
||||
**A:** I don't care. Also, that's not a question.
|
||||
|
||||
**Q:** I'm using a tweak for <feature> on my installation, can you add it?
|
||||
**A:** Submit a PR, create a feature request issue or drop me a message. If I find the functionality simple, useful and not dependent on any 3rd party modules or executables (including also *Chocolatey*, *NuGet*, *Ninite* or other automation solutions), I might add it.
|
||||
|
||||
**Q:** Can I use the script or modify it for my / my company's needs?
|
||||
**A:** Sure, knock yourself out. Just don't forget to include copyright notice as per MIT license requirements. I'd also suggest including a link to this GitHub repo as it's very likely that something will be changed, added or improved to keep track with future versions of Windows 10.
|
||||
|
||||
**Q:** Why are there repeated pieces of code throughout some functions?
|
||||
**A:** So you can directly take a function block or a line from within a function and use it elsewhere, without elaborating on any dependencies.
|
||||
|
||||
**Q:** For how long are you going to maintain the script?
|
||||
**A:** As long as I use Windows 10.
|
||||
|
||||
**Q:** I really like the script. Is there any way to express gratitude and send a donation?
|
||||
**A:** Feel free to send donations via [PayPal donation link](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=disassembler%40dasm%2ecz&item_name=Disassembler&no_shipping=1). Any amount is appreciated, just be aware that PayPal charges [mediation fees](https://www.paypal.com/selfhelp/article/FAQ690). Also be aware that donations are completely voluntary and I'm not obliged to make any script adjustments in your favor regardless of the donated amount.
|
||||
|
||||
|
||||
|
||||
## Windows builds overview
|
||||
|
||||
| Version | Code name | Marketing name | Build |
|
||||
| :-----: | ----------------------- | ---------------------- | :---: |
|
||||
| 1507 | Threshold 1 (TH1 / RTM) | N/A | 10240 |
|
||||
| 1511 | Threshold 2 (TH2) | November Update | 10586 |
|
||||
| 1607 | Redstone 1 (RS1) | Anniversary Update | 14393 |
|
||||
| 1703 | Redstone 2 (RS2) | Creators Update | 15063 |
|
||||
| 1709 | Redstone 3 (RS3) | Fall Creators Update | 16299 |
|
||||
| 1803 | Redstone 4 (RS4) | April 2018 Update | 17134 |
|
||||
| 1809 | Redstone 5 (RS5) | October 2018 Update | 17763 |
|
||||
|
||||
|
||||
|
||||
## Advanced usage
|
||||
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Win10.ps1 [-include filename] [-preset filename] [tweakname]
|
||||
|
||||
-include filename load module with user-defined tweaks
|
||||
-preset filename load preset with tweak names to apply
|
||||
tweakname apply tweak with this particular name
|
||||
|
||||
### Presets
|
||||
|
||||
The tweak library consists of separate idempotent functions, containing one tweak each. The functions can be grouped to *presets*. Preset is simply a list of function names which should be called. Any function which is not present or is commented in a preset will not be called, thus the corresponding tweak will not be applied. In order for the script to do something, you need to supply at least one tweak library via `-include` and at least one tweak name, either via `-preset` or directly as command line argument.
|
||||
|
||||
To supply a customized preset, you can either pass the function names directly as arguments.
|
||||
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Win10.ps1 -include Win10.psm1 EnableFirewall EnableDefender
|
||||
|
||||
Or you can create a file where you write the function names (one function name per line, no commas or quotes, whitespaces allowed, comments starting with `#`) and then pass the filename using `-preset` parameter.
|
||||
Example of a preset file `mypreset.txt`:
|
||||
|
||||
# Security tweaks
|
||||
EnableFirewall
|
||||
EnableDefender
|
||||
|
||||
# UI tweaks
|
||||
ShowKnownExtensions
|
||||
ShowHiddenFiles # Only hidden, not system
|
||||
|
||||
Command using the preset file above:
|
||||
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Win10.ps1 -include Win10.psm1 -preset mypreset.txt
|
||||
|
||||
### Includes
|
||||
|
||||
The script also supports inclusion of custom tweaks from user-supplied modules passed via `-include` parameter. The content of the user-supplied module is completely up to the user, however it is strongly recommended to have the tweaks separated in respective functions as the main tweak library has. The user-supplied scripts are loaded into the main script via `Import-Module`, so the library should ideally be a `.psm1` PowerShell module.
|
||||
Example of a user-supplied tweak library `mytweaks.psm1`:
|
||||
|
||||
```powershell
|
||||
Function MyTweak1 {
|
||||
Write-Output "Running MyTweak1..."
|
||||
# Do something
|
||||
}
|
||||
|
||||
Function MyTweak2 {
|
||||
Write-Output "Running MyTweak2..."
|
||||
# Do something else
|
||||
}
|
||||
```
|
||||
|
||||
Command using the script above:
|
||||
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Win10.ps1 -include mytweaks.psm1 MyTweak1 MyTweak2
|
||||
|
||||
### Combination
|
||||
|
||||
All features described above can be combined. You can have a preset which includes both tweaks from the original script and your personal ones. Both `-include` and `-preset` options can be used more than once, so you can split your tweaks into groups and then combine them based on your current needs. The `-include` modules are always imported before the first tweak is applied, so the order of the command line parameters doesn't matter and neither does the order of the tweaks (except for `RequireAdmin`, which should always be called first and `Restart`, which should be always called last). It can happen that some tweaks are applied more than once during a singe run because you have them in multiple presets. That shouldn't cause any problems as the tweaks are idempotent.
|
||||
Example of a preset file `otherpreset.txt`:
|
||||
|
||||
InstallLinuxSubsystem
|
||||
MyTweak1
|
||||
MyTweak2
|
||||
WaitForKey
|
||||
|
||||
Command using all three examples combined:
|
||||
|
||||
powershell.exe -NoProfile -ExecutionPolicy Bypass -File Win10.ps1 -include Win10.psm1 -include mytweaks.psm1 -preset mypreset.txt -preset otherpreset.txt Restart
|
||||
|
||||
|
||||
|
||||
## Maintaining own forks
|
||||
|
||||
The easiest way to customize the script settings it is to create your own preset and, if needed, your own tweak scripts as described above. For easy start, you can base the modifications on the *Default.cmd* and *Default.preset* and maintain just that. If you choose to fork the script anyway, you don't need to comment or remove the actual functions in *Win10.psm1*, because if they are not called, they are not used.
|
||||
|
||||
If you wish to make more elaborate modifications of the basic script and incorporate some personal tweaks or adjustments, then I suggest doing it in a following way:
|
||||
|
||||
1. Fork the repository on GitHub (obviously).
|
||||
2. Clone your fork on your computer.
|
||||
|
||||
```
|
||||
git clone https://github.com/<yournamehere>/Win10-Initial-Setup-Script
|
||||
cd Win10-Initial-Setup-Script
|
||||
```
|
||||
|
||||
3. Add the original repository as a remote (*upstream*).
|
||||
|
||||
```
|
||||
git remote add upstream https://github.com/Disassembler0/Win10-Initial-Setup-Script
|
||||
```
|
||||
|
||||
4. Commit your modifications as you see fit.
|
||||
5. Once there are new additions in the upstream, create a temporary branch, fetch the changes and reset the branch to be identical with this repository.
|
||||
|
||||
```
|
||||
git branch upstream
|
||||
git checkout upstream
|
||||
git fetch upstream
|
||||
git reset --hard upstream/master
|
||||
```
|
||||
|
||||
6. When you have the upstream branch up to date, check back your master and rebase it based on the upstream branch. If there are some conflicts between the changesets, you'll be asked to resolve them manually.
|
||||
|
||||
```
|
||||
git checkout master
|
||||
git rebase upstream
|
||||
```
|
||||
|
||||
7. Eventually, delete the upstream branch and force push your changes back onto GitHub.
|
||||
|
||||
```
|
||||
git branch -D upstream
|
||||
git push -f master
|
||||
```
|
||||
|
||||
**Word of warning:** Rebasing and force-pushing will change the history of your commits. The upside is that your adjustments will always stay on top of the commit history. The downside is that everybody remote-tracking your repository will always have to rebase and force-push too, otherwise their commit history will not match yours.
|
||||
|
||||
|
||||
|
||||
## Contribution guidelines
|
||||
|
||||
Following is a list of rules which I'm trying to apply in this project. The rules are not binding and I accept pull requests even if they don't adhere to them, as long as their purpose and content are clear. In cases when there are too many rule violations, I might simply redo the whole functionality and reject the PR while still crediting you. If you'd like to make my work easier, please consider adhering to the following rules too.
|
||||
|
||||
### Function naming
|
||||
Try to give a function a meaningful name up to 25 characters long, which gives away the purpose of the function. Use verbs like `Enable`/`Disable`, `Show`/`Hide`, `Install`/`Uninstall`, `Add`/`Remove` in the beginning of the function name. In case the function doesn't fit any of these verbs, come up with another name, beginning with the verb `Set`, which indicates what the function does, e.g. `SetCurrentNetworkPrivate` and `SetCurrentNetworkPublic`.
|
||||
|
||||
### Revert functions
|
||||
Always add a function with opposite name (or equivalent) which reverts the behavior to default. The default is considered freshly installed Windows 10 or Windows Server 2016 with no adjustments made during or after the installation. If you don't have access to either of these, create the revert function to the best of your knowledge and I will fill in the rest if necessary.
|
||||
|
||||
### Function similarities
|
||||
Check if there isn't already a function with similar purpose as the one you're trying to add. As long as the name and objective of the existing function is unchanged, feel free to add your tweak to that function rather than creating a new one.
|
||||
|
||||
### Function grouping
|
||||
Try to group functions thematically. There are already several major groups (privacy, security, services etc.), but even within these, some tweaks may be related to each other. In such case, add a new tweak below the existing one and not to the end of the whole group.
|
||||
|
||||
### Default preset
|
||||
Always add a reference to the tweak and its revert function in the *Default.preset*. Add references to both functions on the same line (mind the spaces) and always comment out the revert function. Whether to comment out also the tweak in the default preset is a matter of personal preference. The rule of thumb is that if the tweak makes the system faster, smoother, more secure and less obtrusive, it should be enabled by default. Usability has preference over performance (that's why e.g. indexing is kept enabled).
|
||||
|
||||
### Repeatability
|
||||
Unless applied on unsupported system, all functions have to be applicable repeatedly without any errors. When you're creating a registry key, always check first if the key doesn't happen to already exist. When you're deleting registry value, always append `-ErrorAction SilentlyContinue` to prevent errors while deleting already deleted values.
|
||||
|
||||
### Input / output hiding
|
||||
Suppress all output generated by commands and cmdlets using `| Out-Null` or `-ErrorAction SilentlyContinue` where applicable. Whenever an input is needed, use appropriate arguments to suppress the prompt and programmatically provide values for the command to run (e.g. using `-Confirm:$false`). The only acceptable output is from the `Write-Output` cmdlets in the beginning of each function and from non-suppressible cmdlets like `Remove-AppxPackage`.
|
||||
|
||||
### Registry
|
||||
Create the registry keys only if they don't exist on fresh installation if Windows 10 or Windows Server 2016. When deleting registry, delete only registry values, not the whole keys. When you're setting registry values, always use `Set-ItemProperty` instead of `New-ItemProperty`. When you're removing registry values, choose either `Set-ItemProperty` or `Remove-ItemProperty` to reinstate the same situation as it was on the clean installation. Again, if you don't know what the original state was, let me know in PR description and I will fill in the gaps. When you need to use `HKEY_USERS` registry hive, always add following snippet before the registry modification to ensure portability.
|
||||
|
||||
```powershell
|
||||
If (!(Test-Path "HKU:")) {
|
||||
New-PSDrive -Name HKU -PSProvider Registry -Root HKEY_USERS | Out-Null
|
||||
}
|
||||
```
|
||||
|
||||
### Force usage
|
||||
Star Wars jokes aside, don't use `-Force` option unless absolutely necessary. The only permitted case is when you're creating a new registry key (not a value) and you need to ensure that all parent keys will be created as well. In such case always check first if the key doesn't already exist, otherwise you will delete all its existing values.
|
||||
|
||||
### Comments
|
||||
Always add a simple comment above the function briefly describing what the function does, especially if it has an ambiguous name or if there is some logic hidden under the hood. If you know that the tweak doesn't work on some editions of Windows 10 or on Windows Server, state it in the comment too. Add a `Write-Output` cmdlet with the short description of action also to the first line of the function body, so the user can see what is being executed and which function is the problematic one whenever an error occurs. The comment is written in present simple tense, the `Write-Output` in present continuous with ellipsis (resp. three dots) at the end.
|
||||
|
||||
### Coding style
|
||||
Indent using tabs, enclose all string values in double quotes (`"`) and strictly use `PascalCase` wherever possible. Put opening curly bracket on the same line as the function name or condition, but leave the closing bracket on a separate line for readability.
|
||||
|
||||
### Examples
|
||||
|
||||
**Naming example**: Consider function `EnableFastMenu`. What does it do? Which menu? How fast is *fast*? A better name might be `EnableFastMenuFlyout`, so it's a bit clearer that we're talking about the menu flyouts delays. But the counterpart function would be `DisableFastMenuFlyouts` which is not entirely true. We're not *disabling* anything, we're just making it slow again. So even better might be to name them `SetFastMenuFlyouts` and `SetSlowMenuFlyouts`. Or better yet, just add the functionality to already existing `SetVisualFXPerformance`/`SetVisualFXAppearance`. Even though the names are not 100% match, they aim to tweak similar aspects and operate within the same registry keys.
|
||||
|
||||
**Coding example:** The following code applies most of the rules mentioned above (naming, output hiding, repeatability, force usage, comments and coding style).
|
||||
|
||||
```powershell
|
||||
# Enable some feature
|
||||
Function EnableSomeFeature {
|
||||
Write-Output "Enabling some feature..."
|
||||
If (!(Test-Path "HKLM:\Some\Registry\Key")) {
|
||||
New-Item -Path "HKLM:\Some\Registry\Key" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\Some\Registry\Key" -Name "SomeValueName" -Type String -Value "SomeValue"
|
||||
}
|
||||
|
||||
# Disable some feature
|
||||
Function DisableSomeFeature {
|
||||
Write-Output "Disabling some feature..."
|
||||
Remove-ItemProperty -Path "HKLM:\Some\Registry\Key" -Name "SomeValueName" -ErrorAction SilentlyContinue
|
||||
}
|
||||
```
|
||||
620
Win10.ps1
620
Win10.ps1
@@ -1,577 +1,43 @@
|
||||
##########
|
||||
# Win10 Initial Setup Script
|
||||
# Author: Disassembler <disassembler@dasm.cz>
|
||||
# Version: 1.4, 2016-01-16
|
||||
##########
|
||||
|
||||
# Ask for elevated permissions if required
|
||||
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
|
||||
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs
|
||||
Exit
|
||||
}
|
||||
|
||||
|
||||
|
||||
##########
|
||||
# Privacy Settings
|
||||
##########
|
||||
|
||||
# Disable Telemetry
|
||||
Write-Host "Disabling Telemetry..."
|
||||
Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry" -Type DWord -Value 0
|
||||
|
||||
# Enable Telemetry
|
||||
# Remove-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\DataCollection" -Name "AllowTelemetry"
|
||||
|
||||
# Disable Wi-Fi Sense
|
||||
Write-Host "Disabling Wi-Fi Sense..."
|
||||
If (!(Test-Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting")) {
|
||||
New-Item -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 0
|
||||
|
||||
# Enable Wi-Fi Sense
|
||||
# Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting" -Name "Value" -Type DWord -Value 1
|
||||
# Set-ItemProperty -Path "HKLM:\Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots" -Name "Value" -Type DWord -Value 1
|
||||
|
||||
# Disable SmartScreen Filter
|
||||
Write-Host "Disabling SmartScreen Filter..."
|
||||
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "SmartScreenEnabled" -Type String -Value "Off"
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation" -Type DWord -Value 0
|
||||
|
||||
# Enable SmartScreen Filter
|
||||
# Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "SmartScreenEnabled" -Type String -Value "RequireAdmin"
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AppHost" -Name "EnableWebContentEvaluation"
|
||||
|
||||
# Disable Bing Search in Start Menu
|
||||
Write-Host "Disabling Bing Search in Start Menu..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled" -Type DWord -Value 0
|
||||
|
||||
# Enable Bing Search in Start Menu
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "BingSearchEnabled"
|
||||
|
||||
# Disable Location Tracking
|
||||
Write-Host "Disabling Location Tracking..."
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 0
|
||||
|
||||
# Enable Location Tracking
|
||||
# Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}" -Name "SensorPermissionState" -Type DWord -Value 1
|
||||
# Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Services\lfsvc\Service\Configuration" -Name "Status" -Type DWord -Value 1
|
||||
|
||||
# Disable Feedback
|
||||
Write-Host "Disabling Feedback..."
|
||||
If (!(Test-Path "HKCU:\Software\Microsoft\Siuf\Rules")) {
|
||||
New-Item -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod" -Type DWord -Value 0
|
||||
|
||||
# Enable Feedback
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Siuf\Rules" -Name "NumberOfSIUFInPeriod"
|
||||
|
||||
# Disable Advertising ID
|
||||
Write-Host "Disabling Advertising ID..."
|
||||
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo")) {
|
||||
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled" -Type DWord -Value 0
|
||||
|
||||
# Enable Advertising ID
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo" -Name "Enabled"
|
||||
|
||||
# Disable Cortana
|
||||
Write-Host "Disabling Cortana..."
|
||||
If (!(Test-Path "HKCU:\Software\Microsoft\Personalization\Settings")) {
|
||||
New-Item -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy" -Type DWord -Value 0
|
||||
If (!(Test-Path "HKCU:\Software\Microsoft\InputPersonalization")) {
|
||||
New-Item -Path "HKCU:\Software\Microsoft\InputPersonalization" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 1
|
||||
If (!(Test-Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore")) {
|
||||
New-Item -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Force | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts" -Type DWord -Value 0
|
||||
|
||||
# Enable Cortana
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Personalization\Settings" -Name "AcceptedPrivacyPolicy"
|
||||
# Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitTextCollection" -Type DWord -Value 0
|
||||
# Set-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization" -Name "RestrictImplicitInkCollection" -Type DWord -Value 0
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\InputPersonalization\TrainedDataStore" -Name "HarvestContacts"
|
||||
|
||||
# Restrict Windows Update P2P only to local network
|
||||
Write-Host "Restricting Windows Update P2P only to local network..."
|
||||
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode" -Type DWord -Value 1
|
||||
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization")) {
|
||||
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode" -Type DWord -Value 3
|
||||
|
||||
# Unrestrict Windows Update P2P
|
||||
# Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization\Config" -Name "DODownloadMode"
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\DeliveryOptimization" -Name "SystemSettingsDownloadMode"
|
||||
|
||||
# Remove AutoLogger file and restrict directory
|
||||
Write-Host "Removing AutoLogger file and restricting directory..."
|
||||
$autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
|
||||
If (Test-Path "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl") {
|
||||
Remove-Item "$autoLoggerDir\AutoLogger-Diagtrack-Listener.etl"
|
||||
}
|
||||
icacls $autoLoggerDir /deny SYSTEM:`(OI`)`(CI`)F | Out-Null
|
||||
|
||||
# Unrestrict AutoLogger directory
|
||||
# $autoLoggerDir = "$env:PROGRAMDATA\Microsoft\Diagnosis\ETLLogs\AutoLogger"
|
||||
# icacls $autoLoggerDir /grant:r SYSTEM:`(OI`)`(CI`)F | Out-Null
|
||||
|
||||
# Stop and disable Diagnostics Tracking Service
|
||||
Write-Host "Stopping and disabling Diagnostics Tracking Service..."
|
||||
Stop-Service "DiagTrack"
|
||||
Set-Service "DiagTrack" -StartupType Disabled
|
||||
|
||||
# Enable and start Diagnostics Tracking Service
|
||||
# Set-Service "DiagTrack" -StartupType Automatic
|
||||
# Start-Service "DiagTrack"
|
||||
|
||||
# Stop and disable WAP Push Service
|
||||
Write-Host "Stopping and disabling WAP Push Service..."
|
||||
Stop-Service "dmwappushservice"
|
||||
Set-Service "dmwappushservice" -StartupType Disabled
|
||||
|
||||
# Enable and start WAP Push Service
|
||||
# Set-Service "dmwappushservice" -StartupType Automatic
|
||||
# Start-Service "dmwappushservice"
|
||||
# Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\dmwappushservice" -Name "DelayedAutoStart" -Type DWord -Value 1
|
||||
|
||||
|
||||
|
||||
##########
|
||||
# Service Tweaks
|
||||
##########
|
||||
|
||||
# Lower UAC level
|
||||
Write-Host "Lowering UAC level..."
|
||||
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 0
|
||||
|
||||
# Raise UAC level
|
||||
# Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "ConsentPromptBehaviorAdmin" -Type DWord -Value 5
|
||||
# Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "PromptOnSecureDesktop" -Type DWord -Value 1
|
||||
|
||||
# Enable sharing mapped drives between users
|
||||
Write-Host "Enabling sharing mapped drives between users..."
|
||||
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections" -Type DWord -Value 1
|
||||
|
||||
# Disable sharing mapped drives between users
|
||||
# Remove-ItemProperty -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\System" -Name "EnableLinkedConnections"
|
||||
|
||||
# Disable Firewall
|
||||
Write-Host "Disabling Firewall..."
|
||||
Set-NetFirewallProfile -Profile * -Enabled False
|
||||
|
||||
# Enable Firewall
|
||||
# Set-NetFirewallProfile -Profile * -Enabled True
|
||||
|
||||
# Disable Windows Defender
|
||||
Write-Host "Disabling Windows Defender..."
|
||||
Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Type DWord -Value 1
|
||||
|
||||
# Enable Windows Defender
|
||||
# Remove-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware"
|
||||
|
||||
# Disable Windows Update automatic restart
|
||||
Write-Host "Disabling Windows Update automatic restart..."
|
||||
Set-ItemProperty -Path "HKLM:\Software\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 1
|
||||
|
||||
# Enable Windows Update automatic restart
|
||||
# Set-ItemProperty -Path "HKLM:\Software\Microsoft\WindowsUpdate\UX\Settings" -Name "UxOption" -Type DWord -Value 0
|
||||
|
||||
# Stop and disable Home Groups services
|
||||
Write-Host "Stopping and disabling Home Groups services..."
|
||||
Stop-Service "HomeGroupListener"
|
||||
Set-Service "HomeGroupListener" -StartupType Disabled
|
||||
Stop-Service "HomeGroupProvider"
|
||||
Set-Service "HomeGroupProvider" -StartupType Disabled
|
||||
|
||||
# Enable and start Home Groups services
|
||||
# Set-Service "HomeGroupListener" -StartupType Manual
|
||||
# Set-Service "HomeGroupProvider" -StartupType Manual
|
||||
# Start-Service "HomeGroupProvider"
|
||||
|
||||
# Disable Remote Assistance
|
||||
Write-Host "Disabling Remote Assistance..."
|
||||
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 0
|
||||
|
||||
# Enable Remote Assistance
|
||||
# Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Remote Assistance" -Name "fAllowToGetHelp" -Type DWord -Value 1
|
||||
|
||||
# Enable Remote Desktop w/o Network Level Authentication
|
||||
Write-Host "Enabling Remote Desktop w/o Network Level Authentication..."
|
||||
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 0
|
||||
|
||||
# Disable Remote Desktop
|
||||
# Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server" -Name "fDenyTSConnections" -Type DWord -Value 1
|
||||
# Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "UserAuthentication" -Type DWord -Value 1
|
||||
|
||||
|
||||
|
||||
##########
|
||||
# UI Tweaks
|
||||
##########
|
||||
|
||||
# Disable Action Center
|
||||
Write-Host "Disabling Action Center..."
|
||||
If (!(Test-Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer")) {
|
||||
New-Item -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter" -Type DWord -Value 1
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled" -Type DWord -Value 0
|
||||
|
||||
# Enable Action Center
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Policies\Microsoft\Windows\Explorer" -Name "DisableNotificationCenter"
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\PushNotifications" -Name "ToastEnabled"
|
||||
|
||||
# Disable Lock screen
|
||||
Write-Host "Disabling Lock screen..."
|
||||
If (!(Test-Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization")) {
|
||||
New-Item -Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization" | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen" -Type DWord -Value 1
|
||||
|
||||
# Enable Lock screen
|
||||
# Remove-ItemProperty -Path "HKLM:\Software\Policies\Microsoft\Windows\Personalization" -Name "NoLockScreen"
|
||||
|
||||
# Disable Autoplay
|
||||
Write-Host "Disabling Autoplay..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 1
|
||||
|
||||
# Enable Autoplay
|
||||
# Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers" -Name "DisableAutoplay" -Type DWord -Value 0
|
||||
|
||||
# Disable Autorun for all drives
|
||||
Write-Host "Disabling Autorun for all drives..."
|
||||
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer")) {
|
||||
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun" -Type DWord -Value 255
|
||||
|
||||
# Enable Autorun
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" -Name "NoDriveTypeAutoRun"
|
||||
|
||||
# Disable Sticky keys prompt
|
||||
Write-Host "Disabling Sticky keys prompt..."
|
||||
Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "506"
|
||||
|
||||
# Enable Sticky keys prompt
|
||||
# Set-ItemProperty -Path "HKCU:\Control Panel\Accessibility\StickyKeys" -Name "Flags" -Type String -Value "510"
|
||||
|
||||
# Hide Search button / box
|
||||
Write-Host "Hiding Search Box / Button..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode" -Type DWord -Value 0
|
||||
|
||||
# Show Search button / box
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Search" -Name "SearchboxTaskbarMode"
|
||||
|
||||
# Hide Task View button
|
||||
Write-Host "Hiding Task View button..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton" -Type DWord -Value 0
|
||||
|
||||
# Show Task View button
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "ShowTaskViewButton"
|
||||
|
||||
# Show small icons in taskbar
|
||||
Write-Host "Showing small icons in taskbar..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons" -Type DWord -Value 1
|
||||
|
||||
# Show large icons in taskbar
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarSmallIcons"
|
||||
|
||||
# Show titles in taskbar
|
||||
Write-Host "Showing titles in taskbar..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel" -Type DWord -Value 1
|
||||
|
||||
# Hide titles in taskbar
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "TaskbarGlomLevel"
|
||||
|
||||
# Show all tray icons
|
||||
Write-Host "Showing all tray icons..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray" -Type DWord -Value 0
|
||||
|
||||
# Hide tray icons as needed
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer" -Name "EnableAutoTray"
|
||||
|
||||
# Show known file extensions
|
||||
Write-Host "Showing known file extensions..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 0
|
||||
|
||||
# Hide known file extensions
|
||||
# Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "HideFileExt" -Type DWord -Value 1
|
||||
|
||||
# Show hidden files
|
||||
Write-Host "Showing hidden files..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 1
|
||||
|
||||
# Hide hidden files
|
||||
# Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "Hidden" -Type DWord -Value 2
|
||||
|
||||
# Change default Explorer view to "Computer"
|
||||
Write-Host "Changing default Explorer view to `"Computer`"..."
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo" -Type DWord -Value 1
|
||||
|
||||
# Change default Explorer view to "Quick Access"
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" -Name "LaunchTo"
|
||||
|
||||
# Show Computer shortcut on desktop
|
||||
Write-Host "Showing Computer shortcut on desktop..."
|
||||
If (!(Test-Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu")) {
|
||||
New-Item -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Type DWord -Value 0
|
||||
Set-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}" -Type DWord -Value 0
|
||||
|
||||
# Hide Computer shortcut from desktop
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\ClassicStartMenu" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
|
||||
# Remove-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\HideDesktopIcons\NewStartPanel" -Name "{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
|
||||
|
||||
# Remove Desktop icon from computer namespace
|
||||
Write-Host "Removing Desktop icon from computer namespace..."
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}" -Recurse -ErrorAction SilentlyContinue
|
||||
|
||||
# Add Desktop icon to computer namespace
|
||||
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}"
|
||||
|
||||
# Remove Documents icon from computer namespace
|
||||
Write-Host "Removing Documents icon from computer namespace..."
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}" -Recurse -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}" -Recurse -ErrorAction SilentlyContinue
|
||||
|
||||
# Add Documents icon to computer namespace
|
||||
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{d3162b92-9365-467a-956b-92703aca08af}"
|
||||
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A8CDFF1C-4878-43be-B5FD-F8091C1C60D0}"
|
||||
|
||||
# Remove Downloads icon from computer namespace
|
||||
Write-Host "Removing Downloads icon from computer namespace..."
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}" -Recurse -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}" -Recurse -ErrorAction SilentlyContinue
|
||||
|
||||
# Add Downloads icon to computer namespace
|
||||
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{088e3905-0323-4b02-9826-5d99428e115f}"
|
||||
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{374DE290-123F-4565-9164-39C4925E467B}"
|
||||
|
||||
# Remove Music icon from computer namespace
|
||||
Write-Host "Removing Music icon from computer namespace..."
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}" -Recurse -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}" -Recurse -ErrorAction SilentlyContinue
|
||||
|
||||
# Add Music icon to computer namespace
|
||||
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3dfdf296-dbec-4fb4-81d1-6a3438bcf4de}"
|
||||
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{1CF1260C-4DD0-4ebb-811F-33C572699FDE}"
|
||||
|
||||
# Remove Pictures icon from computer namespace
|
||||
Write-Host "Removing Pictures icon from computer namespace..."
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}" -Recurse -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}" -Recurse -ErrorAction SilentlyContinue
|
||||
|
||||
# Add Pictures icon to computer namespace
|
||||
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{24ad3ad4-a569-4530-98e1-ab02f9417aa8}"
|
||||
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{3ADD1653-EB32-4cb0-BBD7-DFA0ABB5ACCA}"
|
||||
|
||||
# Remove Videos icon from computer namespace
|
||||
Write-Host "Removing Videos icon from computer namespace..."
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}" -Recurse -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}" -Recurse -ErrorAction SilentlyContinue
|
||||
|
||||
# Add Videos icon to computer namespace
|
||||
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{f86fa3ab-70d2-4fc7-9c99-fcbf05467f3a}"
|
||||
# New-Item -Path "HKLM:\Software\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{A0953C92-50DC-43bf-BE83-3742FED03C9C}"
|
||||
|
||||
# Add secondary en-US keyboard
|
||||
Write-Host "Adding secondary en-US keyboard..."
|
||||
$langs = Get-WinUserLanguageList
|
||||
$langs.Add("en-US")
|
||||
Set-WinUserLanguageList $langs -Force
|
||||
|
||||
# Remove secondary en-US keyboard
|
||||
# $langs = Get-WinUserLanguageList
|
||||
# Set-WinUserLanguageList ($langs | ? {$_.LanguageTag -ne "en-US"}) -Force
|
||||
|
||||
|
||||
|
||||
##########
|
||||
# Remove unwanted applications
|
||||
##########
|
||||
|
||||
# Disable OneDrive
|
||||
Write-Host "Disabling OneDrive..."
|
||||
If (!(Test-Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive")) {
|
||||
New-Item -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" | Out-Null
|
||||
}
|
||||
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC" -Type DWord -Value 1
|
||||
|
||||
# Enable OneDrive
|
||||
# Remove-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\OneDrive" -Name "DisableFileSyncNGSC"
|
||||
|
||||
# Uninstall OneDrive
|
||||
Write-Host "Uninstalling OneDrive..."
|
||||
Stop-Process -Name OneDrive -ErrorAction SilentlyContinue
|
||||
Start-Sleep -s 3
|
||||
$onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
|
||||
If (!(Test-Path $onedrive)) {
|
||||
$onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
|
||||
}
|
||||
Start-Process $onedrive "/uninstall" -NoNewWindow -Wait
|
||||
Start-Sleep -s 3
|
||||
Stop-Process -Name explorer -ErrorAction SilentlyContinue
|
||||
Start-Sleep -s 3
|
||||
Remove-Item "$env:USERPROFILE\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
|
||||
Remove-Item "$env:LOCALAPPDATA\Microsoft\OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
|
||||
Remove-Item "$env:PROGRAMDATA\Microsoft OneDrive" -Force -Recurse -ErrorAction SilentlyContinue
|
||||
If (Test-Path "$env:SYSTEMDRIVE\OneDriveTemp") {
|
||||
Remove-Item "$env:SYSTEMDRIVE\OneDriveTemp" -Force -Recurse -ErrorAction SilentlyContinue
|
||||
}
|
||||
If (!(Test-Path "HKCR:")) {
|
||||
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
|
||||
}
|
||||
Remove-Item -Path "HKCR:\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
|
||||
Remove-Item -Path "HKCR:\Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}" -Recurse -ErrorAction SilentlyContinue
|
||||
|
||||
# Install OneDrive
|
||||
# $onedrive = "$env:SYSTEMROOT\SysWOW64\OneDriveSetup.exe"
|
||||
# If (!(Test-Path $onedrive)) {
|
||||
# $onedrive = "$env:SYSTEMROOT\System32\OneDriveSetup.exe"
|
||||
# }
|
||||
# Start-Process $onedrive -NoNewWindow
|
||||
|
||||
# Uninstall default Microsoft applications
|
||||
Write-Host "Uninstalling default Microsoft applications..."
|
||||
Get-AppxPackage "Microsoft.3DBuilder" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.BingFinance" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.BingNews" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.BingSports" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.BingWeather" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.Getstarted" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.MicrosoftOfficeHub" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.MicrosoftSolitaireCollection" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.Office.OneNote" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.People" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.SkypeApp" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.Windows.Photos" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.WindowsAlarms" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.WindowsCamera" | Remove-AppxPackage
|
||||
Get-AppxPackage "microsoft.windowscommunicationsapps" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.WindowsMaps" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.WindowsPhone" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.WindowsSoundRecorder" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.XboxApp" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.ZuneMusic" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.ZuneVideo" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.AppConnector" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.ConnectivityStore" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.Office.Sway" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.Messaging" | Remove-AppxPackage
|
||||
Get-AppxPackage "Microsoft.CommsPhone" | Remove-AppxPackage
|
||||
Get-AppxPackage "9E2F88E3.Twitter" | Remove-AppxPackage
|
||||
Get-AppxPackage "king.com.CandyCrushSodaSaga" | Remove-AppxPackage
|
||||
|
||||
# Install default Microsoft applications
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.3DBuilder").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingFinance").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingNews").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingSports").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.BingWeather").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Getstarted").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.MicrosoftOfficeHub").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.MicrosoftSolitaireCollection").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Office.OneNote").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.People").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.SkypeApp").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Windows.Photos").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsAlarms").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsCamera").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.windowscommunicationsapps").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsMaps").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsPhone").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.WindowsSoundRecorder").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.XboxApp").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.ZuneMusic").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.ZuneVideo").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.AppConnector").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.ConnectivityStore").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Office.Sway").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.Messaging").InstallLocation)\AppXManifest.xml"
|
||||
# Add-AppxPackage -DisableDevelopmentMode -Register "$($(Get-AppXPackage -AllUsers "Microsoft.CommsPhone").InstallLocation)\AppXManifest.xml"
|
||||
# In case you have removed them for good, you can try to restore the files using installation medium as follows
|
||||
# New-Item C:\Mnt -Type Directory | Out-Null
|
||||
# dism /Mount-Image /ImageFile:D:\sources\install.wim /index:1 /ReadOnly /MountDir:C:\Mnt
|
||||
# robocopy /S /SEC /R:0 "C:\Mnt\Program Files\WindowsApps" "C:\Program Files\WindowsApps"
|
||||
# dism /Unmount-Image /Discard /MountDir:C:\Mnt
|
||||
# Remove-Item -Path C:\Mnt -Recurse
|
||||
|
||||
# Uninstall Windows Media Player
|
||||
Write-Host "Uninstalling Windows Media Player..."
|
||||
dism /online /Disable-Feature /FeatureName:MediaPlayback /Quiet /NoRestart
|
||||
|
||||
# Install Windows Media Player
|
||||
# dism /online /Enable-Feature /FeatureName:MediaPlayback /Quiet /NoRestart
|
||||
|
||||
# Uninstall Work Folders Client
|
||||
Write-Host "Uninstalling Work Folders Client..."
|
||||
dism /online /Disable-Feature /FeatureName:WorkFolders-Client /Quiet /NoRestart
|
||||
|
||||
# Install Work Folders Client
|
||||
# dism /online /Enable-Feature /FeatureName:WorkFolders-Client /Quiet /NoRestart
|
||||
|
||||
# Set Photo Viewer as default for bmp, gif, jpg and png
|
||||
Write-Host "Setting Photo Viewer as default for bmp, gif, jpg, png and tif..."
|
||||
If (!(Test-Path "HKCR:")) {
|
||||
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
|
||||
}
|
||||
ForEach ($type in @("Paint.Picture", "giffile", "jpegfile", "pngfile")) {
|
||||
New-Item -Path $("HKCR:\$type\shell\open") -Force | Out-Null
|
||||
New-Item -Path $("HKCR:\$type\shell\open\command") | Out-Null
|
||||
Set-ItemProperty -Path $("HKCR:\$type\shell\open") -Name "MuiVerb" -Type ExpandString -Value "@%ProgramFiles%\Windows Photo Viewer\photoviewer.dll,-3043"
|
||||
Set-ItemProperty -Path $("HKCR:\$type\shell\open\command") -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1"
|
||||
}
|
||||
|
||||
# Remove or reset default open action for bmp, gif, jpg and png
|
||||
# If (!(Test-Path "HKCR:")) {
|
||||
# New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
|
||||
# }
|
||||
# Remove-Item -Path "HKCR:\Paint.Picture\shell\open" -Recurse
|
||||
# Remove-ItemProperty -Path "HKCR:\giffile\shell\open" -Name "MuiVerb"
|
||||
# Set-ItemProperty -Path "HKCR:\giffile\shell\open" -Name "CommandId" -Type String -Value "IE.File"
|
||||
# Set-ItemProperty -Path "HKCR:\giffile\shell\open\command" -Name "(Default)" -Type String -Value "`"$env:SystemDrive\Program Files\Internet Explorer\iexplore.exe`" %1"
|
||||
# Set-ItemProperty -Path "HKCR:\giffile\shell\open\command" -Name "DelegateExecute" -Type String -Value "{17FE9752-0B5A-4665-84CD-569794602F5C}"
|
||||
# Remove-Item -Path "HKCR:\jpegfile\shell\open" -Recurse
|
||||
# Remove-Item -Path "HKCR:\pngfile\shell\open" -Recurse
|
||||
|
||||
# Show Photo Viewer in "Open with..."
|
||||
Write-Host "Showing Photo Viewer in `"Open with...`""
|
||||
If (!(Test-Path "HKCR:")) {
|
||||
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
|
||||
}
|
||||
New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\command" -Force | Out-Null
|
||||
New-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Force | Out-Null
|
||||
Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open" -Name "MuiVerb" -Type String -Value "@photoviewer.dll,-3043"
|
||||
Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open\command" -Name "(Default)" -Type ExpandString -Value "%SystemRoot%\System32\rundll32.exe `"%ProgramFiles%\Windows Photo Viewer\PhotoViewer.dll`", ImageView_Fullscreen %1"
|
||||
Set-ItemProperty -Path "HKCR:\Applications\photoviewer.dll\shell\open\DropTarget" -Name "Clsid" -Type String -Value "{FFE2A43C-56B9-4bf5-9A79-CC6D4285608A}"
|
||||
|
||||
# Remove Photo Viewer from "Open with..."
|
||||
# If (!(Test-Path "HKCR:")) {
|
||||
# New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | Out-Null
|
||||
# }
|
||||
# Remove-Item -Path "HKCR:\Applications\photoviewer.dll\shell\open" -Recurse
|
||||
|
||||
|
||||
|
||||
##########
|
||||
# Restart
|
||||
##########
|
||||
Write-Host
|
||||
Write-Host "Press any key to restart your system..." -ForegroundColor Black -BackgroundColor White
|
||||
$key = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
|
||||
Write-Host "Restarting..."
|
||||
Restart-Computer
|
||||
##########
|
||||
# Win10 / WinServer2016 Initial Setup Script - Main execution loop
|
||||
# Author: Disassembler <disassembler@dasm.cz>
|
||||
# Version: v3.1, 2018-10-04
|
||||
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
|
||||
##########
|
||||
|
||||
# Relaunch the script with administrator privileges
|
||||
Function RequireAdmin {
|
||||
If (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]"Administrator")) {
|
||||
Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`" $PSCommandArgs" -Verb RunAs
|
||||
Exit
|
||||
}
|
||||
}
|
||||
|
||||
$tweaks = @()
|
||||
$PSCommandArgs = @()
|
||||
|
||||
# Parse and resolve paths in passed arguments
|
||||
$i = 0
|
||||
While ($i -lt $args.Length) {
|
||||
If ($args[$i].ToLower() -eq "-include") {
|
||||
# Resolve full path to the included file
|
||||
$include = Resolve-Path $args[++$i]
|
||||
$PSCommandArgs += "-include `"$include`""
|
||||
# Import the included file as a module
|
||||
Import-Module -Name $include
|
||||
} ElseIf ($args[$i].ToLower() -eq "-preset") {
|
||||
# Resolve full path to the preset file
|
||||
$preset = Resolve-Path $args[++$i]
|
||||
$PSCommandArgs += "-preset `"$preset`""
|
||||
# Load tweak names from the preset file
|
||||
$tweaks += Get-Content $preset -ErrorAction Stop | ForEach-Object { $_.Split("#")[0].Trim() } | Where-Object { $_ -ne "" }
|
||||
} Else {
|
||||
$PSCommandArgs += $args[$i]
|
||||
# Load tweak names from command line
|
||||
$tweaks += $args[$i]
|
||||
}
|
||||
$i++
|
||||
}
|
||||
|
||||
# Call the desired tweak functions
|
||||
$tweaks | ForEach-Object { Invoke-Expression $_ }
|
||||
|
||||
2862
Win10.psm1
Normal file
2862
Win10.psm1
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user