Skip to content

Instantly share code, notes, and snippets.

@flipeador
Last active April 18, 2025 14:23
Show Gist options
  • Save flipeador/5422a5bf4f983fff6eab85bc62731278 to your computer and use it in GitHub Desktop.
Save flipeador/5422a5bf4f983fff6eab85bc62731278 to your computer and use it in GitHub Desktop.
Install, activate, debloat, and tweak Windows.

Install Windows

Download a Windows ISO image.

Create a bootable USB drive with Rufus.

Extract a specific Window edition.

# Replace `X` with the USB drive letter.
$WimFile = "X:\sources\install.wim"

# List all Windows editions in the image file.
Get-WindowsImage -ImagePath $WimFile

# Exports a copy of the specified edition to another image file.
$ImageIndex = 6 # Replace `6` with the desired edition.
$WimFile2 = $WimFile.Replace(".", "2.")
Export-WindowsImage -SourceImagePath $WimFile -SourceIndex $ImageIndex -DestinationImagePath $WimFile2 -CompressionType Max -CheckIntegrity

# Replace the old image file with the new one.
Remove-Item -Path $WimFile -Force
Rename-Item -Path $WimFile2 -NewName $WimFile

Removes the 8dot3 file names for all files. 1

$MountPath = "C:\~wim"

New-Item -Path $MountPath -ItemType Directory -Force

Get-WindowsImage -ImagePath $WimFile | ForEach-Object -Process {
    Write-Host "Processing:" $_.ImageName
    Mount-WindowsImage -Path $MountPath -ImagePath $WimFile -Index $_.ImageIndex
    fsutil.exe 8dot3name strip /f /s $MountPath
    Write-Host "Press any key to continue..."
    [System.Console]::ReadKey($false)
    Dismount-WindowsImage -Path $MountPath -Save
}

After Windows has been installed.

# Disable the 8dot3 name creation.
fsutil.exe 8dot3name set C: 1

Create the autounattend.xml file in the USB root directory.

https://schneegans.de/windows/unattend-generator/?LanguageMode=Interactive&ProcessorArchitecture=amd64&BypassRequirementsCheck=true&BypassNetworkCheck=true&ComputerNameMode=Custom&ComputerName=DESKTOP-MLJ&CompactOsMode=Default&TimeZoneMode=Implicit&PartitionMode=Interactive&WindowsEditionMode=Generic&WindowsEdition=pro&UserAccountMode=Unattended&AccountName0=&AccountName1=&AccountName2=&AccountName3=&AccountName4=&AutoLogonMode=Builtin&BuiltinAdministratorPassword=12345678&PasswordExpirationMode=Unlimited&LockoutMode=Custom&LockoutThreshold=3&LockoutWindow=10&LockoutDuration=30&HideFiles=Hidden&ShowFileExtensions=true&LaunchToThisPC=true&TaskbarSearch=Hide&TaskbarIconsMode=Empty&DisableWidgets=true&LeftTaskbar=true&DisableBingResults=true&StartTilesMode=Default&StartPinsMode=Empty&DisableDefender=true&EnableLongPaths=true&HardenSystemDriveAcl=true&DisableLastAccess=true&PreventAutomaticReboot=true&TurnOffSystemSounds=true&DisableAppSuggestions=true&PreventDeviceEncryption=true&HideEdgeFre=true&DisablePointerPrecision=true&DeleteWindowsOld=true&ProcessAudit=true&ProcessAuditCommandLine=true&EffectsMode=Appearance&DesktopIconsMode=Custom&IconRecycleBin=true&WifiMode=Interactive&ExpressSettings=DisableAll&KeysMode=Skip&ColorMode=Custom&SystemColorTheme=Dark&AppsColorTheme=Dark&AccentColor=%230078d4&EnableTransparency=true&WallpaperMode=Default&Remove3DViewer=true&RemoveBingSearch=true&RemoveCamera=true&RemoveClipchamp=true&RemoveClock=true&RemoveCopilot=true&RemoveCortana=true&RemoveDevHome=true&RemoveFamily=true&RemoveFeedbackHub=true&RemoveGetHelp=true&RemoveHandwriting=true&RemoveInternetExplorer=true&RemoveMailCalendar=true&RemoveMaps=true&RemoveMathInputPanel=true&RemoveMediaFeatures=true&RemoveMixedReality=true&RemoveZuneVideo=true&RemoveNews=true&RemoveOffice365=true&RemoveOneDrive=true&RemoveOneNote=true&RemoveOneSync=true&RemoveOpenSSHClient=true&RemoveOutlook=true&RemovePaint3D=true&RemovePeople=true&RemovePowerAutomate=true&RemovePowerShell2=true&RemovePowerShellISE=true&RemoveQuickAssist=true&RemoveRecall=true&RemoveRdpClient=true&RemoveSkype=true&RemoveSnippingTool=true&RemoveSolitaire=true&RemoveSpeech=true&RemoveStepsRecorder=true&RemoveTeams=true&RemoveGetStarted=true&RemoveToDo=true&RemoveVoiceRecorder=true&RemoveWallet=true&RemoveWeather=true&RemoveFaxAndScan=true&RemoveWindowsHello=true&RemoveWindowsMediaPlayer=true&RemoveZuneMusic=true&RemoveWordPad=true&RemoveXboxApps=true&RemoveYourPhone=true&SystemScript0=fsutil.exe+8dot3name+set+C%3A+1&SystemScriptType0=Cmd&WdacMode=Skip

Tool Description
ShutUp10 Free antispy tool for Windows 10/11.
OoAppBuster Free uninstaller for unwanted apps.
Winaero Tweaker Utility that lets you adjust various Windows settings.
Microsoft-Activation-Scripts Open-source Windows and Office activator.
Configure AdGuard DNS (Encrypted) PowerShell script to configure AdGuard DNS (Encrypted).

Footnotes

  1. Installing Windows 10/11 without 8.3 file names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment