Skip to content

Instantly share code, notes, and snippets.

@maxwelleite
Last active June 16, 2023 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxwelleite/935e7f43c73d730e1b15c9b2ef0c1623 to your computer and use it in GitHub Desktop.
Save maxwelleite/935e7f43c73d730e1b15c9b2ef0c1623 to your computer and use it in GitHub Desktop.
Batch script to download latest Win10-Initial-Setup-Script and execute using your own local profile Win10-Initial-Setup-Script-Execute.preset (change before execute).
@echo off
:: Author: Maxwel Leite
:: Website: http://needforbits.wordpress.com/
:: Description: Batch script to download latest Win10-Initial-Setup-Script*
:: and execute using your own local profile Win10-Initial-Setup-Script-Execute.preset (change before execute).
:: * PowerShell script for automation of routine tasks done after fresh installations of Windows 10 / Server 2016 / Server 2019
:: (https://github.com/Win10debloater/Win10-Initial-Setup-Script)
::
if not "%1"=="am_admin" call powershell -h | %WINDIR%\System32\find.exe /i "powershell" > nul && if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin > nul & exit)
setlocal
cd /d %~dp0
rem clean
rd /s /q "Win10-Initial-Setup-Script-master" > nul
echo Downloading latest Win10-Initial-Setup-Script.zip
powershell -command "Invoke-WebRequest https://github.com/Disassembler0/Win10-Initial-Setup-Script/archive/refs/heads/master.zip -OutFile Win10-Initial-Setup-Script.zip"
echo Extracting Win10-Initial-Setup-Script.zip
Call :UnZipFile "%~dp0" "%~dp0Win10-Initial-Setup-Script.zip"
echo Executing Win10-Initial-Setup-Script
copy /y Win10-Initial-Setup-Script-Execute.preset Win10-Initial-Setup-Script-master\Default.preset > nul
cd "Win10-Initial-Setup-Script-master"
call Default.cmd
rem powershell -NoProfile -ExecutionPolicy Bypass -File "%~dp0Win10.ps1" -include "%~dp0Win10.psm1" -preset "%~dp0Default.preset"
pause
exit /b
:UnZipFile <ExtractTo> <newzipfile>
set vbs="%temp%\_.vbs"
if exist %vbs% del /f /q %vbs%
>%vbs% echo Set fso = CreateObject("Scripting.FileSystemObject")
>>%vbs% echo If NOT fso.FolderExists(%1) Then
>>%vbs% echo fso.CreateFolder(%1)
>>%vbs% echo End If
>>%vbs% echo set objShell = CreateObject("Shell.Application")
>>%vbs% echo set FilesInZip=objShell.NameSpace(%2).items
>>%vbs% echo objShell.NameSpace(%1).CopyHere(FilesInZip)
>>%vbs% echo Set fso = Nothing
>>%vbs% echo Set objShell = Nothing
cscript //nologo %vbs%
if exist %vbs% del /f /q %vbs%
##########
# Win 10 / Server 2016 / Server 2019 Initial Setup Script - Default preset
# Author: Disassembler <disassembler@dasm.cz>
# Version: v3.10, 2020-07-15
# Source: https://github.com/Disassembler0/Win10-Initial-Setup-Script
##########
# Win10-Initial-Setup-Script-Execute.preset
# Modified: 17-nov-2020
### Require administrator privileges ###
RequireAdmin
### Privacy Tweaks ###
DisableTelemetry # EnableTelemetry
DisableCortana # EnableCortana
DisableWiFiSense # EnableWiFiSense
# DisableSmartScreen # EnableSmartScreen
DisableWebSearch # EnableWebSearch
DisableAppSuggestions # EnableAppSuggestions
DisableActivityHistory # EnableActivityHistory
# DisableSensors # EnableSensors
DisableLocation # EnableLocation
DisableMapUpdates # EnableMapUpdates
DisableFeedback # EnableFeedback
DisableTailoredExperiences # EnableTailoredExperiences
DisableAdvertisingID # EnableAdvertisingID
DisableWebLangList # EnableWebLangList
# DisableBiometrics # EnableBiometrics
# DisableCamera # EnableCamera
# DisableMicrophone # EnableMicrophone
DisableErrorReporting # EnableErrorReporting
# SetP2PUpdateLocal # SetP2PUpdateInternet # SetP2PUpdateDisable
DisableDiagTrack # EnableDiagTrack
DisableWAPPush # EnableWAPPush
# EnableClearRecentFiles # DisableClearRecentFiles
# DisableRecentFiles # EnableRecentFiles
### UWP Privacy Tweaks ###
DisableUWPBackgroundApps # EnableUWPBackgroundApps
# DisableUWPVoiceActivation # EnableUWPVoiceActivation
# DisableUWPNotifications # EnableUWPNotifications
# DisableUWPAccountInfo # EnableUWPAccountInfo
# DisableUWPContacts # EnableUWPContacts
# DisableUWPCalendar # EnableUWPCalendar
# DisableUWPPhoneCalls # EnableUWPPhoneCalls
# DisableUWPCallHistory # EnableUWPCallHistory
# DisableUWPEmail # EnableUWPEmail
# DisableUWPTasks # EnableUWPTasks
# DisableUWPMessaging # EnableUWPMessaging
# DisableUWPRadios # EnableUWPRadios
# DisableUWPOtherDevices # EnableUWPOtherDevices
# DisableUWPDiagInfo # EnableUWPDiagInfo
# DisableUWPFileSystem # EnableUWPFileSystem
# DisableUWPSwapFile # EnableUWPSwapFile
### Security Tweaks ###
# SetUACLow # SetUACHigh
# EnableSharingMappedDrives # DisableSharingMappedDrives
DisableAdminShares # EnableAdminShares
# DisableFirewall # EnableFirewall
# HideDefenderTrayIcon # ShowDefenderTrayIcon
# DisableDefender # EnableDefender
# DisableDefenderCloud # EnableDefenderCloud
# EnableCtrldFolderAccess # DisableCtrldFolderAccess
# EnableCIMemoryIntegrity # DisableCIMemoryIntegrity
# EnableDefenderAppGuard # DisableDefenderAppGuard
HideAccountProtectionWarn # ShowAccountProtectionWarn
DisableDownloadBlocking # EnableDownloadBlocking
# DisableScriptHost # EnableScriptHost
EnableScriptHost
EnableDotNetStrongCrypto # DisableDotNetStrongCrypto
# EnableMeltdownCompatFlag # DisableMeltdownCompatFlag
EnableF8BootMenu # DisableF8BootMenu
# DisableBootRecovery # EnableBootRecovery
# DisableRecoveryAndReset # EnableRecoveryAndReset
SetDEPOptOut # SetDEPOptIn
### Network Tweaks ###
SetCurrentNetworkPrivate # SetCurrentNetworkPublic
# SetUnknownNetworksPrivate # SetUnknownNetworksPublic
DisableNetDevicesAutoInst # EnableNetDevicesAutoInst
DisableHomeGroups # EnableHomeGroups
# DisableSMB1 # EnableSMB1
# DisableSMBServer # EnableSMBServer
# DisableNetBIOS # EnableNetBIOS
# DisableLLMNR # EnableLLMNR
# DisableLLDP # EnableLLDP
# DisableLLTD # EnableLLTD
# DisableMSNetClient # EnableMSNetClient
# DisableQoS # EnableQoS
# DisableIPv4 # EnableIPv4
# DisableIPv6 # EnableIPv6
# DisableNCSIProbe # EnableNCSIProbe
# DisableConnectionSharing # EnableConnectionSharing
DisableRemoteAssistance # EnableRemoteAssistance
# EnableRemoteDesktop # DisableRemoteDesktop
### Service Tweaks ###
# DisableUpdateMSRT # EnableUpdateMSRT
DisableUpdateDriver # EnableUpdateDriver
EnableUpdateMSProducts # DisableUpdateMSProducts
# DisableUpdateAutoDownload # EnableUpdateAutoDownload
DisableUpdateRestart # EnableUpdateRestart
DisableMaintenanceWakeUp # EnableMaintenanceWakeUp
# DisableAutoRestartSignOn # EnableAutoRestartSignOn
DisableSharedExperiences # EnableSharedExperiences
# EnableClipboardHistory # DisableClipboardHistory
DisableAutoplay # EnableAutoplay
DisableAutorun # EnableAutorun
EnableRestorePoints # DisableRestorePoints
EnableStorageSense # DisableStorageSense
# DisableDefragmentation # EnableDefragmentation
# DisableSuperfetch # EnableSuperfetch
# DisableIndexing # EnableIndexing
# DisableRecycleBin # EnableRecycleBin
EnableNTFSLongPaths # DisableNTFSLongPaths
# DisableNTFSLastAccess # EnableNTFSLastAccess
# SetBIOSTimeUTC # SetBIOSTimeLocal
DisableHibernation # EnableHibernation
# DisableSleepButton # EnableSleepButton
# DisableSleepTimeout # EnableSleepTimeout
# DisableFastStartup # EnableFastStartup
DisableAutoRebootOnCrash # EnableAutoRebootOnCrash
### UI Tweaks ###
DisableActionCenter # EnableActionCenter
DisableLockScreen # EnableLockScreen
# DisableLockScreenRS1 # EnableLockScreenRS1
HideNetworkFromLockScreen # ShowNetworkOnLockScreen
ShowShutdownOnLockScreen # HideShutdownFromLockScreen
DisableLockScreenBlur # EnableLockScreenBlur
# DisableAeroShake # EnableAeroShake
DisableAccessibilityKeys # EnableAccessibilityKeys
ShowTaskManagerDetails # HideTaskManagerDetails
ShowFileOperationsDetails # HideFileOperationsDetails
EnableFileDeleteConfirm # DisableFileDeleteConfirm
HideTaskbarSearch # ShowTaskbarSearchIcon # ShowTaskbarSearchBox
HideTaskView # ShowTaskView
#ShowSmallTaskbarIcons # ShowLargeTaskbarIcons
ShowLargeTaskbarIcons
SetTaskbarCombineAlways # SetTaskbarCombineNever # SetTaskbarCombineWhenFull
HideTaskbarPeopleIcon # ShowTaskbarPeopleIcon
#ShowTrayIcons # HideTrayIcons
HideTrayIcons
# ShowSecondsInTaskbar # HideSecondsFromTaskbar
DisableSearchAppInStore # EnableSearchAppInStore
DisableNewAppPrompt # EnableNewAppPrompt
# HideRecentlyAddedApps # ShowRecentlyAddedApps
# HideMostUsedApps # ShowMostUsedApps
# SetWinXMenuPowerShell # SetWinXMenuCmd
# SetControlPanelSmallIcons # SetControlPanelLargeIcons # SetControlPanelCategories
DisableShortcutInName # EnableShortcutInName
# HideShortcutArrow # ShowShortcutArrow
SetVisualFXPerformance # SetVisualFXAppearance
# EnableTitleBarColor # DisableTitleBarColor
# SetAppsDarkMode # SetAppsLightMode
# SetSystemLightMode # SetSystemDarkMode
# AddENKeyboard # RemoveENKeyboard
# EnableNumlock # DisableNumlock
# DisableEnhPointerPrecision # EnableEnhPointerPrecision
# SetSoundSchemeNone # SetSoundSchemeDefault
# DisableStartupSound # EnableStartupSound
# DisableChangingSoundScheme # EnableChangingSoundScheme
# EnableVerboseStatus # DisableVerboseStatus
DisableF1HelpKey # EnableF1HelpKey
### Explorer UI Tweaks ###
ShowExplorerTitleFullPath # HideExplorerTitleFullPath
ShowKnownExtensions # HideKnownExtensions
#ShowHiddenFiles # HideHiddenFiles
HideHiddenFiles
# ShowSuperHiddenFiles # HideSuperHiddenFiles
# ShowEmptyDrives # HideEmptyDrives
# ShowFolderMergeConflicts # HideFolderMergeConflicts
EnableNavPaneExpand # DisableNavPaneExpand
# ShowNavPaneAllFolders # HideNavPaneAllFolders
# ShowNavPaneLibraries # HideNavPaneLibraries
# EnableFldrSeparateProcess # DisableFldrSeparateProcess
# EnableRestoreFldrWindows # DisableRestoreFldrWindows
# ShowEncCompFilesColor # HideEncCompFilesColor
# DisableSharingWizard # EnableSharingWizard
# HideSelectCheckboxes # ShowSelectCheckboxes
HideSyncNotifications # ShowSyncNotifications
HideRecentShortcuts # ShowRecentShortcuts
SetExplorerThisPC # SetExplorerQuickAccess
#HideQuickAccess # ShowQuickAccess
ShowQuickAccess
ShowRecycleBinOnDesktop # HideRecycleBinFromDesktop
ShowThisPCOnDesktop # HideThisPCFromDesktop
ShowUserFolderOnDesktop # HideUserFolderFromDesktop
# ShowControlPanelOnDesktop # HideControlPanelFromDesktop
# ShowNetworkOnDesktop # HideNetworkFromDesktop
ShowDesktopIcons # HideDesktopIcons
# ShowBuildNumberOnDesktop # HideBuildNumberFromDesktop
HideDesktopFromThisPC # ShowDesktopInThisPC
ShowDesktopInExplorer # HideDesktopFromExplorer
#HideDocumentsFromThisPC # ShowDocumentsInThisPC
ShowDocumentsInThisPC
# HideDocumentsFromExplorer # ShowDocumentsInExplorer
#HideDownloadsFromThisPC # ShowDownloadsInThisPC
ShowDownloadsInThisPC
# HideDownloadsFromExplorer # ShowDownloadsInExplorer
#HideMusicFromThisPC # ShowMusicInThisPC
ShowMusicInThisPC
# HideMusicFromExplorer # ShowMusicInExplorer
#HidePicturesFromThisPC # ShowPicturesInThisPC
ShowPicturesInThisPC
# HidePicturesFromExplorer # ShowPicturesInExplorer
#HideVideosFromThisPC # ShowVideosInThisPC
ShowVideosInThisPC
# HideVideosFromExplorer # ShowVideosInExplorer
Hide3DObjectsFromThisPC # Show3DObjectsInThisPC
# Hide3DObjectsFromExplorer # Show3DObjectsInExplorer
# HideNetworkFromExplorer # ShowNetworkInExplorer
# HideIncludeInLibraryMenu # ShowIncludeInLibraryMenu
# HideGiveAccessToMenu # ShowGiveAccessToMenu
# HideShareMenu # ShowShareMenu
# DisableThumbnails # EnableThumbnails
#DisableThumbnailCache # EnableThumbnailCache
EnableThumbnailCache
DisableThumbsDBOnNetwork # EnableThumbsDBOnNetwork
### Application Tweaks ###
DisableOneDrive # EnableOneDrive
UninstallOneDrive # InstallOneDrive
UninstallMsftBloat # InstallMsftBloat
UninstallThirdPartyBloat # InstallThirdPartyBloat
# UninstallWindowsStore # InstallWindowsStore
DisableXboxFeatures # EnableXboxFeatures
# DisableFullscreenOptims # EnableFullscreenOptims
DisableAdobeFlash # EnableAdobeFlash
DisableEdgePreload # EnableEdgePreload
DisableEdgeShortcutCreation # EnableEdgeShortcutCreation
DisableIEFirstRun # EnableIEFirstRun
DisableFirstLogonAnimation # EnableFirstLogonAnimation
DisableMediaSharing # EnableMediaSharing
# DisableMediaOnlineAccess # EnableMediaOnlineAccess
# EnableDeveloperMode # DisableDeveloperMode
# UninstallMediaPlayer # InstallMediaPlayer
# UninstallInternetExplorer # InstallInternetExplorer
# UninstallWorkFolders # InstallWorkFolders
# UninstallHelloFace # InstallHelloFace
# UninstallMathRecognizer # InstallMathRecognizer
# UninstallPowerShellV2 # InstallPowerShellV2
# UninstallPowerShellISE # InstallPowerShellISE
# InstallLinuxSubsystem # UninstallLinuxSubsystem
# InstallHyperV # UninstallHyperV
# UninstallSSHClient # InstallSSHClient
# InstallSSHServer # UninstallSSHServer
# InstallTelnetClient # UninstallTelnetClient
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment