bejiitas_wrath

Windows 11 autounattend.xml for a local account.

Oct 30th, 2025
897
0
Never
7
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 25.03 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State">
  3.     <!--https://schneegans.de/windows/unattend-generator/?LanguageMode=Unattended&UILanguage=en-US&Locale=en-US&Keyboard=00000409&GeoLocation=244&ProcessorArchitecture=amd64&BypassNetworkCheck=true&ComputerNameMode=Custom&ComputerName=Zeus&CompactOsMode=Default&TimeZoneMode=Explicit&TimeZone=AUS+Eastern+Standard+Time&PartitionMode=Interactive&DiskAssertionMode=Skip&WindowsEditionMode=Generic&WindowsEdition=pro&InstallFromMode=Automatic&PEMode=Default&UserAccountMode=InteractiveLocal&PasswordExpirationMode=Unlimited&LockoutMode=Default&HideFiles=Hidden&ShowFileExtensions=true&ClassicContextMenu=true&LaunchToThisPC=true&ShowEndTask=true&TaskbarSearch=Box&TaskbarIconsMode=Default&DisableWidgets=true&LeftTaskbar=true&ShowAllTrayIcons=true&DisableBingResults=true&StartTilesMode=Default&StartPinsMode=Empty&HardenSystemDriveAcl=true&PreventAutomaticReboot=true&DisableEdgeStartupBoost=true&DeleteWindowsOld=true&EffectsMode=Performance&DesktopIconsMode=Default&StartFoldersMode=Default&WifiMode=Interactive&ExpressSettings=DisableAll&LockKeysMode=Skip&StickyKeysMode=Disabled&ColorMode=Default&WallpaperMode=Solid&WallpaperColor=%23008080&LockScreenMode=Default&RemoveBingSearch=true&RemoveXboxApps=true&WdacMode=Skip-->
  4.     <settings pass="offlineServicing"></settings>
  5.     <settings pass="windowsPE">
  6.         <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
  7.             <UILanguage>en-US</UILanguage>
  8.         </component>
  9.         <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
  10.             <UserData>
  11.                 <ProductKey>
  12.                     <Key>VK7JG-NPHTM-C97JM-9MPGT-3V66T</Key>
  13.                     <WillShowUI>OnError</WillShowUI>
  14.                 </ProductKey>
  15.                 <AcceptEula>true</AcceptEula>
  16.             </UserData>
  17.             <UseConfigurationSet>false</UseConfigurationSet>
  18.         </component>
  19.     </settings>
  20.     <settings pass="generalize"></settings>
  21.     <settings pass="specialize">
  22.         <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
  23.             <ComputerName>Zeus</ComputerName>
  24.             <TimeZone>AUS Eastern Standard Time</TimeZone>
  25.         </component>
  26.         <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
  27.             <RunSynchronous>
  28.                 <RunSynchronousCommand wcm:action="add">
  29.                     <Order>1</Order>
  30.                     <Path>powershell.exe -WindowStyle Normal -NoProfile -Command "$xml = [xml]::new(); $xml.Load('C:\Windows\Panther\unattend.xml'); $sb = [scriptblock]::Create( $xml.unattend.Extensions.ExtractScript ); Invoke-Command -ScriptBlock $sb -ArgumentList $xml;"</Path>
  31.                 </RunSynchronousCommand>
  32.                 <RunSynchronousCommand wcm:action="add">
  33.                     <Order>2</Order>
  34.                     <Path>powershell.exe -WindowStyle Normal -NoProfile -Command "Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\Specialize.ps1' -Raw | Invoke-Expression;"</Path>
  35.                 </RunSynchronousCommand>
  36.                 <RunSynchronousCommand wcm:action="add">
  37.                     <Order>3</Order>
  38.                     <Path>reg.exe load "HKU\DefaultUser" "C:\Users\Default\NTUSER.DAT"</Path>
  39.                 </RunSynchronousCommand>
  40.                 <RunSynchronousCommand wcm:action="add">
  41.                     <Order>4</Order>
  42.                     <Path>powershell.exe -WindowStyle Normal -NoProfile -Command "Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\DefaultUser.ps1' -Raw | Invoke-Expression;"</Path>
  43.                 </RunSynchronousCommand>
  44.                 <RunSynchronousCommand wcm:action="add">
  45.                     <Order>5</Order>
  46.                     <Path>reg.exe unload "HKU\DefaultUser"</Path>
  47.                 </RunSynchronousCommand>
  48.             </RunSynchronous>
  49.         </component>
  50.     </settings>
  51.     <settings pass="auditSystem"></settings>
  52.     <settings pass="auditUser"></settings>
  53.     <settings pass="oobeSystem">
  54.         <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
  55.             <InputLocale>0409:00000409</InputLocale>
  56.             <SystemLocale>en-US</SystemLocale>
  57.             <UILanguage>en-US</UILanguage>
  58.             <UserLocale>en-US</UserLocale>
  59.         </component>
  60.         <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
  61.             <OOBE>
  62.                 <ProtectYourPC>3</ProtectYourPC>
  63.                 <HideEULAPage>true</HideEULAPage>
  64.                 <HideWirelessSetupInOOBE>false</HideWirelessSetupInOOBE>
  65.                 <HideOnlineAccountScreens>true</HideOnlineAccountScreens>
  66.             </OOBE>
  67.             <FirstLogonCommands>
  68.                 <SynchronousCommand wcm:action="add">
  69.                     <Order>1</Order>
  70.                     <CommandLine>powershell.exe -WindowStyle Normal -NoProfile -Command "Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\FirstLogon.ps1' -Raw | Invoke-Expression;"</CommandLine>
  71.                 </SynchronousCommand>
  72.             </FirstLogonCommands>
  73.         </component>
  74.     </settings>
  75.     <Extensions xmlns="https://schneegans.de/windows/unattend-generator/">
  76.         <ExtractScript>
  77. param(
  78.     [xml] $Document
  79. );
  80.  
  81. foreach( $file in $Document.unattend.Extensions.File ) {
  82.     $path = [System.Environment]::ExpandEnvironmentVariables( $file.GetAttribute( 'path' ) );
  83.     mkdir -Path( $path | Split-Path -Parent ) -ErrorAction 'SilentlyContinue';
  84.     $encoding = switch( [System.IO.Path]::GetExtension( $path ) ) {
  85.         { $_ -in '.ps1', '.xml' } { [System.Text.Encoding]::UTF8; }
  86.         { $_ -in '.reg', '.vbs', '.js' } { [System.Text.UnicodeEncoding]::new( $false, $true ); }
  87.         default { [System.Text.Encoding]::Default; }
  88.     };
  89.     $bytes = $encoding.GetPreamble() + $encoding.GetBytes( $file.InnerText.Trim() );
  90.     [System.IO.File]::WriteAllBytes( $path, $bytes );
  91. }
  92.         </ExtractScript>
  93.         <File path="C:\Windows\Setup\Scripts\RemovePackages.ps1">
  94. $selectors = @(
  95.     'Microsoft.BingSearch';
  96.     'Microsoft.Xbox.TCUI';
  97.     'Microsoft.XboxApp';
  98.     'Microsoft.XboxGameOverlay';
  99.     'Microsoft.XboxGamingOverlay';
  100.     'Microsoft.XboxIdentityProvider';
  101.     'Microsoft.XboxSpeechToTextOverlay';
  102.     'Microsoft.GamingApp';
  103. );
  104. $getCommand = {
  105.   Get-AppxProvisionedPackage -Online;
  106. };
  107. $filterCommand = {
  108.   $_.DisplayName -eq $selector;
  109. };
  110. $removeCommand = {
  111.   [CmdletBinding()]
  112.   param(
  113.     [Parameter( Mandatory, ValueFromPipeline )]
  114.     $InputObject
  115.   );
  116.   process {
  117.     $InputObject | Remove-AppxProvisionedPackage -AllUsers -Online -ErrorAction 'Continue';
  118.   }
  119. };
  120. $type = 'Package';
  121. $logfile = 'C:\Windows\Setup\Scripts\RemovePackages.log';
  122. &amp; {
  123.     $installed = &amp; $getCommand;
  124.     foreach( $selector in $selectors ) {
  125.         $result = [ordered] @{
  126.             Selector = $selector;
  127.         };
  128.         $found = $installed | Where-Object -FilterScript $filterCommand;
  129.         if( $found ) {
  130.             $result.Output = $found | &amp; $removeCommand;
  131.             if( $? ) {
  132.                 $result.Message = "$type removed.";
  133.             } else {
  134.                 $result.Message = "$type not removed.";
  135.                 $result.Error = $Error[0];
  136.             }
  137.         } else {
  138.             $result.Message = "$type not installed.";
  139.         }
  140.         $result | ConvertTo-Json -Depth 3 -Compress;
  141.     }
  142. } *&gt;&amp;1 | Out-String &gt;&gt; $logfile;
  143.         </File>
  144.         <File path="C:\Windows\Setup\Scripts\ShowAllTrayIcons.ps1">
  145. if( [System.Environment]::OSVersion.Version.Build -lt 20000 ) {
  146.     # Windows 10
  147.     Set-ItemProperty -LiteralPath 'Registry::HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer' -Name 'EnableAutoTray' -Type 'DWord' -Value 0 -Force;
  148. } else {
  149.     # Windows 11
  150.     Register-ScheduledTask -TaskName 'ShowAllTrayIcons' -Xml $(
  151.         Get-Content -LiteralPath "C:\Windows\Setup\Scripts\ShowAllTrayIcons.xml" -Raw;
  152.     );
  153. }
  154.         </File>
  155.         <File path="C:\Windows\Setup\Scripts\ShowAllTrayIcons.xml">
  156. &lt;Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"&gt;
  157.     &lt;Triggers&gt;
  158.         &lt;LogonTrigger&gt;
  159.             &lt;Repetition&gt;
  160.                 &lt;Interval&gt;PT1M&lt;/Interval&gt;
  161.                 &lt;StopAtDurationEnd&gt;false&lt;/StopAtDurationEnd&gt;
  162.             &lt;/Repetition&gt;
  163.             &lt;Enabled&gt;true&lt;/Enabled&gt;
  164.         &lt;/LogonTrigger&gt;
  165.     &lt;/Triggers&gt;
  166.     &lt;Principals&gt;
  167.         &lt;Principal id="Author"&gt;
  168.             &lt;GroupId&gt;S-1-5-32-545&lt;/GroupId&gt;
  169.             &lt;RunLevel&gt;LeastPrivilege&lt;/RunLevel&gt;
  170.         &lt;/Principal&gt;
  171.     &lt;/Principals&gt;
  172.     &lt;Settings&gt;
  173.         &lt;MultipleInstancesPolicy&gt;IgnoreNew&lt;/MultipleInstancesPolicy&gt;
  174.         &lt;DisallowStartIfOnBatteries&gt;false&lt;/DisallowStartIfOnBatteries&gt;
  175.         &lt;StopIfGoingOnBatteries&gt;false&lt;/StopIfGoingOnBatteries&gt;
  176.         &lt;AllowHardTerminate&gt;true&lt;/AllowHardTerminate&gt;
  177.         &lt;StartWhenAvailable&gt;false&lt;/StartWhenAvailable&gt;
  178.         &lt;RunOnlyIfNetworkAvailable&gt;false&lt;/RunOnlyIfNetworkAvailable&gt;
  179.         &lt;IdleSettings&gt;
  180.             &lt;StopOnIdleEnd&gt;true&lt;/StopOnIdleEnd&gt;
  181.             &lt;RestartOnIdle&gt;false&lt;/RestartOnIdle&gt;
  182.         &lt;/IdleSettings&gt;
  183.         &lt;AllowStartOnDemand&gt;true&lt;/AllowStartOnDemand&gt;
  184.         &lt;Enabled&gt;true&lt;/Enabled&gt;
  185.         &lt;Hidden&gt;false&lt;/Hidden&gt;
  186.         &lt;RunOnlyIfIdle&gt;false&lt;/RunOnlyIfIdle&gt;
  187.         &lt;WakeToRun&gt;false&lt;/WakeToRun&gt;
  188.         &lt;ExecutionTimeLimit&gt;PT72H&lt;/ExecutionTimeLimit&gt;
  189.         &lt;Priority&gt;7&lt;/Priority&gt;
  190.     &lt;/Settings&gt;
  191.     &lt;Actions Context="Author"&gt;
  192.         &lt;Exec&gt;
  193.             &lt;Command&gt;C:\Windows\System32\wscript.exe&lt;/Command&gt;
  194.             &lt;Arguments&gt;C:\Windows\Setup\Scripts\ShowAllTrayIcons.vbs&lt;/Arguments&gt;
  195.         &lt;/Exec&gt;
  196.     &lt;/Actions&gt;
  197. &lt;/Task&gt;
  198.         </File>
  199.         <File path="C:\Windows\Setup\Scripts\ShowAllTrayIcons.vbs">
  200. HKCU = &amp;H80000001
  201. key = "Control Panel\NotifyIconSettings"
  202. Set reg = GetObject("winmgmts://./root/default:StdRegProv")
  203. If reg.EnumKey(HKCU, key, names) = 0 Then
  204.     If Not IsNull(names) Then
  205.         For Each name In names
  206.             reg.SetDWORDValue HKCU, key + "\" + name, "IsPromoted", 1
  207.         Next
  208.     End If
  209. End If
  210.         </File>
  211.         <File path="C:\Windows\Setup\Scripts\MoveActiveHours.vbs">
  212. HKLM = &amp;H80000002
  213. key = "SOFTWARE\Microsoft\WindowsUpdate\UX\Settings"
  214. Set reg = GetObject("winmgmts://./root/default:StdRegProv")
  215. current = Hour(Now)
  216. reg.SetDWORDValue HKLM, key, "ActiveHoursStart", ( current + 23 ) Mod 24
  217. reg.SetDWORDValue HKLM, key, "ActiveHoursEnd", ( current + 11 ) Mod 24
  218. reg.SetDWORDValue HKLM, key, "SmartActiveHoursState", 2
  219.         </File>
  220.         <File path="C:\Windows\Setup\Scripts\MoveActiveHours.xml">
  221. &lt;Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task"&gt;
  222.     &lt;Triggers&gt;
  223.         &lt;BootTrigger&gt;
  224.             &lt;Repetition&gt;
  225.                 &lt;Interval&gt;PT4H&lt;/Interval&gt;
  226.                 &lt;StopAtDurationEnd&gt;false&lt;/StopAtDurationEnd&gt;
  227.             &lt;/Repetition&gt;
  228.             &lt;Enabled&gt;true&lt;/Enabled&gt;
  229.         &lt;/BootTrigger&gt;
  230.         &lt;RegistrationTrigger&gt;
  231.             &lt;Repetition&gt;
  232.                 &lt;Interval&gt;PT4H&lt;/Interval&gt;
  233.                 &lt;StopAtDurationEnd&gt;false&lt;/StopAtDurationEnd&gt;
  234.             &lt;/Repetition&gt;
  235.             &lt;Enabled&gt;true&lt;/Enabled&gt;
  236.         &lt;/RegistrationTrigger&gt;
  237.     &lt;/Triggers&gt;
  238.     &lt;Principals&gt;
  239.         &lt;Principal id="Author"&gt;
  240.             &lt;UserId&gt;S-1-5-19&lt;/UserId&gt;
  241.             &lt;RunLevel&gt;LeastPrivilege&lt;/RunLevel&gt;
  242.         &lt;/Principal&gt;
  243.     &lt;/Principals&gt;
  244.     &lt;Settings&gt;
  245.         &lt;MultipleInstancesPolicy&gt;IgnoreNew&lt;/MultipleInstancesPolicy&gt;
  246.         &lt;DisallowStartIfOnBatteries&gt;false&lt;/DisallowStartIfOnBatteries&gt;
  247.         &lt;StopIfGoingOnBatteries&gt;false&lt;/StopIfGoingOnBatteries&gt;
  248.         &lt;AllowHardTerminate&gt;true&lt;/AllowHardTerminate&gt;
  249.         &lt;StartWhenAvailable&gt;false&lt;/StartWhenAvailable&gt;
  250.         &lt;RunOnlyIfNetworkAvailable&gt;false&lt;/RunOnlyIfNetworkAvailable&gt;
  251.         &lt;IdleSettings&gt;
  252.             &lt;StopOnIdleEnd&gt;true&lt;/StopOnIdleEnd&gt;
  253.             &lt;RestartOnIdle&gt;false&lt;/RestartOnIdle&gt;
  254.         &lt;/IdleSettings&gt;
  255.         &lt;AllowStartOnDemand&gt;true&lt;/AllowStartOnDemand&gt;
  256.         &lt;Enabled&gt;true&lt;/Enabled&gt;
  257.         &lt;Hidden&gt;false&lt;/Hidden&gt;
  258.         &lt;RunOnlyIfIdle&gt;false&lt;/RunOnlyIfIdle&gt;
  259.         &lt;WakeToRun&gt;false&lt;/WakeToRun&gt;
  260.         &lt;ExecutionTimeLimit&gt;PT72H&lt;/ExecutionTimeLimit&gt;
  261.         &lt;Priority&gt;7&lt;/Priority&gt;
  262.     &lt;/Settings&gt;
  263.     &lt;Actions Context="Author"&gt;
  264.         &lt;Exec&gt;
  265.             &lt;Command&gt;C:\Windows\System32\wscript.exe&lt;/Command&gt;
  266.             &lt;Arguments&gt;C:\Windows\Setup\Scripts\MoveActiveHours.vbs&lt;/Arguments&gt;
  267.         &lt;/Exec&gt;
  268.     &lt;/Actions&gt;
  269. &lt;/Task&gt;
  270.         </File>
  271.         <File path="C:\Windows\Setup\Scripts\SetStartPins.ps1">
  272. $json = '{"pinnedList":[]}';
  273. if( [System.Environment]::OSVersion.Version.Build -lt 20000 ) {
  274.     return;
  275. }
  276. $key = 'Registry::HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start';
  277. New-Item -Path $key -ItemType 'Directory' -ErrorAction 'SilentlyContinue';
  278. Set-ItemProperty -LiteralPath $key -Name 'ConfigureStartPins' -Value $json -Type 'String';
  279.         </File>
  280.         <File path="C:\Windows\Setup\Scripts\SetWallpaper.ps1">
  281. Add-Type -TypeDefinition '
  282.     using System.Drawing;
  283.     using System.Runtime.InteropServices;
  284.    
  285.     public static class WallpaperSetter {
  286.         [DllImport("user32.dll")]
  287.         private static extern bool SetSysColors(
  288.             int cElements,
  289.             int[] lpaElements,
  290.             int[] lpaRgbValues
  291.         );
  292.  
  293.         [DllImport("user32.dll")]
  294.         private static extern bool SystemParametersInfo(
  295.             uint uiAction,
  296.             uint uiParam,
  297.             string pvParam,
  298.             uint fWinIni
  299.         );
  300.  
  301.         public static void SetDesktopBackground(Color color) {
  302.             SystemParametersInfo(20, 0, "", 0);
  303.             SetSysColors(1, new int[] { 1 }, new int[] { ColorTranslator.ToWin32(color) });
  304.         }
  305.  
  306.         public static void SetDesktopImage(string file) {
  307.             SystemParametersInfo(20, 0, file, 0);
  308.         }
  309.     }
  310. ' -ReferencedAssemblies 'System.Drawing';
  311.  
  312. function Set-WallpaperColor {
  313.     param(
  314.         [string]
  315.         $HtmlColor
  316.     );
  317.  
  318.     $color = [System.Drawing.ColorTranslator]::FromHtml( $HtmlColor );
  319.     [WallpaperSetter]::SetDesktopBackground( $color );
  320.     Set-ItemProperty -Path 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers' -Name 'BackgroundType' -Type 'DWord' -Value 1 -Force;
  321.     Set-ItemProperty -Path 'Registry::HKCU\Control Panel\Desktop' -Name 'WallPaper' -Type 'String' -Value '' -Force;
  322.     Set-ItemProperty -Path 'Registry::HKCU\Control Panel\Colors' -Name 'Background' -Type 'String' -Value "$($color.R) $($color.G) $($color.B)" -Force;
  323. }
  324.  
  325. function Set-WallpaperImage {
  326.     param(
  327.         [string]
  328.         $LiteralPath
  329.     );
  330.  
  331.     if( $LiteralPath | Test-Path ) {
  332.         [WallpaperSetter]::SetDesktopImage( $LiteralPath );
  333.         Set-ItemProperty -Path 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers' -Name 'BackgroundType' -Type 'DWord' -Value 0 -Force;
  334.         Set-ItemProperty -Path 'Registry::HKCU\Control Panel\Desktop' -Name 'WallPaper' -Type 'String' -Value $LiteralPath -Force;
  335.     } else {
  336.         "Cannot use '$LiteralPath' as a desktop wallpaper because that file does not exist.";
  337.     }
  338. }
  339. Set-WallpaperColor -HtmlColor '#008080';
  340.         </File>
  341.         <File path="C:\Windows\Setup\Scripts\Specialize.ps1">
  342. $scripts = @(
  343.     {
  344.         reg.exe add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v BypassNRO /t REG_DWORD /d 1 /f;
  345.     };
  346.     {
  347.         Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\RemovePackages.ps1' -Raw | Invoke-Expression;
  348.     };
  349.     {
  350.         net.exe accounts /maxpwage:UNLIMITED;
  351.     };
  352.     {
  353.         icacls.exe C:\ /remove:g "*S-1-5-11"
  354.     };
  355.     {
  356.         reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v AUOptions /t REG_DWORD /d 4 /f;
  357.         reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" /v NoAutoRebootWithLoggedOnUsers /t REG_DWORD /d 1 /f;
  358.     };
  359.     {
  360.         Register-ScheduledTask -TaskName 'MoveActiveHours' -Xml $( Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\MoveActiveHours.xml' -Raw );
  361.     };
  362.     {
  363.         reg.exe add "HKLM\SOFTWARE\Policies\Microsoft\Dsh" /v AllowNewsAndInterests /t REG_DWORD /d 0 /f;
  364.     };
  365.     {
  366.         reg.exe add "HKLM\Software\Policies\Microsoft\Edge\Recommended" /v BackgroundModeEnabled /t REG_DWORD /d 0 /f;
  367.         reg.exe add "HKLM\Software\Policies\Microsoft\Edge\Recommended" /v StartupBoostEnabled /t REG_DWORD /d 0 /f;
  368.     };
  369.     {
  370.         Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\SetStartPins.ps1' -Raw | Invoke-Expression;
  371.     };
  372.     {
  373.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ControlAnimations" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  374.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\AnimateMinMax" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  375.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TaskbarAnimations" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  376.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMAeroPeekEnabled" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  377.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\MenuAnimation" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  378.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\TooltipAnimation" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  379.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\SelectionFade" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  380.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DWMSaveThumbnailEnabled" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  381.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\CursorShadow" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  382.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewShadow" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  383.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ThumbnailsOrIcon" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  384.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListviewAlphaSelect" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  385.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DragFullWindows" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  386.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ComboBoxAnimation" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  387.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\FontSmoothing" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  388.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\ListBoxSmoothScrolling" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  389.         Set-ItemProperty -LiteralPath "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects\DropShadow" -Name 'DefaultValue' -Value 0 -Type 'DWord' -Force;
  390.     };
  391.     {
  392.         reg.exe add "HKU\.DEFAULT\Control Panel\Accessibility\StickyKeys" /v Flags /t REG_SZ /d 10 /f;
  393.     };
  394. );
  395.  
  396. &amp; {
  397.   [float] $complete = 0;
  398.   [float] $increment = 100 / $scripts.Count;
  399.   foreach( $script in $scripts ) {
  400.     Write-Progress -Activity 'Running scripts to customize your Windows installation. Do not close this window.' -PercentComplete $complete;
  401.     '*** Will now execute command &#xAB;{0}&#xBB;.' -f $(
  402.       $str = $script.ToString().Trim() -replace '\s+', ' ';
  403.       $max = 100;
  404.       if( $str.Length -le $max ) {
  405.         $str;
  406.       } else {
  407.         $str.Substring( 0, $max - 1 ) + '&#x2026;';
  408.       }
  409.     );
  410.     $start = [datetime]::Now;
  411.     &amp; $script;
  412.     '*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
  413.     "`r`n" * 3;
  414.     $complete += $increment;
  415.   }
  416. } *&gt;&amp;1 | Out-String &gt;&gt; "C:\Windows\Setup\Scripts\Specialize.log";
  417.         </File>
  418.         <File path="C:\Windows\Setup\Scripts\UserOnce.ps1">
  419. $scripts = @(
  420.     {
  421.         reg.exe add "HKCU\Software\Classes\CLSID\{86ca1aa0-34aa-4e8b-a509-50c905bae2a2}\InprocServer32" /ve /f;
  422.     };
  423.     {
  424.         Set-ItemProperty -LiteralPath 'Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name 'LaunchTo' -Type 'DWord' -Value 1;
  425.     };
  426.     {
  427.         Set-ItemProperty -LiteralPath 'Registry::HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\VisualEffects' -Name 'VisualFXSetting' -Type 'DWord' -Value 2 -Force;
  428.     };
  429.     {
  430.         Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\SetWallpaper.ps1' -Raw | Invoke-Expression;
  431.     };
  432.     {
  433.         Get-Process -Name 'explorer' -ErrorAction 'SilentlyContinue' | Where-Object -FilterScript {
  434.             $_.SessionId -eq ( Get-Process -Id $PID ).SessionId;
  435.         } | Stop-Process -Force;
  436.     };
  437. );
  438.  
  439. &amp; {
  440.   [float] $complete = 0;
  441.   [float] $increment = 100 / $scripts.Count;
  442.   foreach( $script in $scripts ) {
  443.     Write-Progress -Activity 'Running scripts to configure this user account. Do not close this window.' -PercentComplete $complete;
  444.     '*** Will now execute command &#xAB;{0}&#xBB;.' -f $(
  445.       $str = $script.ToString().Trim() -replace '\s+', ' ';
  446.       $max = 100;
  447.       if( $str.Length -le $max ) {
  448.         $str;
  449.       } else {
  450.         $str.Substring( 0, $max - 1 ) + '&#x2026;';
  451.       }
  452.     );
  453.     $start = [datetime]::Now;
  454.     &amp; $script;
  455.     '*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
  456.     "`r`n" * 3;
  457.     $complete += $increment;
  458.   }
  459. } *&gt;&amp;1 | Out-String &gt;&gt; "$env:TEMP\UserOnce.log";
  460.         </File>
  461.         <File path="C:\Windows\Setup\Scripts\DefaultUser.ps1">
  462. $scripts = @(
  463.     {
  464.         reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\GameDVR" /v AppCaptureEnabled /t REG_DWORD /d 0 /f;
  465.     };
  466.     {
  467.         reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "HideFileExt" /t REG_DWORD /d 0 /f;
  468.     };
  469.     {
  470.         Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\ShowAllTrayIcons.ps1' -Raw | Invoke-Expression;
  471.     };
  472.     {
  473.         reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v TaskbarAl /t REG_DWORD /d 0 /f;
  474.     };
  475.     {
  476.         reg.exe add "HKU\DefaultUser\Software\Policies\Microsoft\Windows\Explorer" /v DisableSearchBoxSuggestions /t REG_DWORD /d 1 /f;
  477.     };
  478.     {
  479.         reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\TaskbarDeveloperSettings" /v TaskbarEndTask /t REG_DWORD /d 1 /f;
  480.     };
  481.     {
  482.         reg.exe add "HKU\DefaultUser\Control Panel\Accessibility\StickyKeys" /v Flags /t REG_SZ /d 10 /f;
  483.     };
  484.     {
  485.         reg.exe add "HKU\DefaultUser\Software\Microsoft\Windows\CurrentVersion\RunOnce" /v "UnattendedSetup" /t REG_SZ /d "powershell.exe -WindowStyle Normal -NoProfile -Command \""Get-Content -LiteralPath 'C:\Windows\Setup\Scripts\UserOnce.ps1' -Raw | Invoke-Expression;\""" /f;
  486.     };
  487. );
  488.  
  489. &amp; {
  490.   [float] $complete = 0;
  491.   [float] $increment = 100 / $scripts.Count;
  492.   foreach( $script in $scripts ) {
  493.     Write-Progress -Activity 'Running scripts to modify the default user&#x2019;&#x2019;s registry hive. Do not close this window.' -PercentComplete $complete;
  494.     '*** Will now execute command &#xAB;{0}&#xBB;.' -f $(
  495.       $str = $script.ToString().Trim() -replace '\s+', ' ';
  496.       $max = 100;
  497.       if( $str.Length -le $max ) {
  498.         $str;
  499.       } else {
  500.         $str.Substring( 0, $max - 1 ) + '&#x2026;';
  501.       }
  502.     );
  503.     $start = [datetime]::Now;
  504.     &amp; $script;
  505.     '*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
  506.     "`r`n" * 3;
  507.     $complete += $increment;
  508.   }
  509. } *&gt;&amp;1 | Out-String &gt;&gt; "C:\Windows\Setup\Scripts\DefaultUser.log";
  510.         </File>
  511.         <File path="C:\Windows\Setup\Scripts\FirstLogon.ps1">
  512. $scripts = @(
  513.     {
  514.         cmd.exe /c "rmdir C:\Windows.old";
  515.     };
  516.     {
  517.         Remove-Item -LiteralPath @(
  518.           'C:\Windows\Panther\unattend.xml';
  519.           'C:\Windows\Panther\unattend-original.xml';
  520.           'C:\Windows\Setup\Scripts\Wifi.xml';
  521.         ) -Force -ErrorAction 'SilentlyContinue' -Verbose;
  522.     };
  523. );
  524.  
  525. &amp; {
  526.   [float] $complete = 0;
  527.   [float] $increment = 100 / $scripts.Count;
  528.   foreach( $script in $scripts ) {
  529.     Write-Progress -Activity 'Running scripts to finalize your Windows installation. Do not close this window.' -PercentComplete $complete;
  530.     '*** Will now execute command &#xAB;{0}&#xBB;.' -f $(
  531.       $str = $script.ToString().Trim() -replace '\s+', ' ';
  532.       $max = 100;
  533.       if( $str.Length -le $max ) {
  534.         $str;
  535.       } else {
  536.         $str.Substring( 0, $max - 1 ) + '&#x2026;';
  537.       }
  538.     );
  539.     $start = [datetime]::Now;
  540.     &amp; $script;
  541.     '*** Finished executing command after {0:0} ms.' -f [datetime]::Now.Subtract( $start ).TotalMilliseconds;
  542.     "`r`n" * 3;
  543.     $complete += $increment;
  544.   }
  545. } *&gt;&amp;1 | Out-String &gt;&gt; "C:\Windows\Setup\Scripts\FirstLogon.log";
  546.         </File>
  547.     </Extensions>
  548. </unattend>
  549.  
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
Add Comment
Please, Sign In to add comment