Creating image file for mass distribution in Windows 11


mzimme2

New member
Local time
3:06 PM
Posts
2
OS
win 11 22H2
I am trying to create an image file for mass distribution, and I am using audit mode.
I have tried with the local admin account enabled and I have also tried without enabling the local admin account.
These are the steps I followed after getting auto logged on in audit mode.
I set the task bar to align left.
I turned off gaming.
I set my start menu to show more pins.
I tuned off do not disturb.
I install the Active Directory feature.
I turned on .Net 3.8.
I removed all the icons from the start menu.
I uninstalled all the applications I did not need or want.
I did this manually once, used PowerShell once and tried a debloat script on my 3rd attempt.
I did reboot as need.
The In ran sysprep with generalize and shutdown.
The I captured my image using DISM.
The capture went fine but it is when I try to apply the image the things go off the rail.
If in my unattended I set copy profile to false, when the image is applied my taskbar is back in the center of the screen which I expected.
However, my start menu is blank which is what I wanted and the applications I removed stay removed.
I tried to use a few registry keys to move the task bar to the left for all users but none of them worked.
If I could have found a resolution for this, I may never have tried to copy the profile.
So next I set copy profile to True.
I applied the image, and my taskbar was on the left like I wanted, my desktop icons were all the order I set them up in when I was audit mode.
The problem is my start menu is no longer blank like it was in audit mode, but it also the apps I unpinned as well as the apps I removed live Spotify, Xbox live etc.
I thought that if I had copy profile set to true it would copy the local admin profile over and my start menu would be blank and the apps I removed would not come back but that did not happen.
Did I miss something or do something wrong?
I would love to be able to have the image file mirror what I set up in audit mode, but I cannot seem to accomplish that.
I am using Windows 11 2H2, a laptop to create the image, I have tried Dell as well as Lenovo and results were the same.
System has an SSD Drive 16 GB of memory.
I installed the image on the laptop using a USB stick with no network connections so updates and extras are not installed.
I went into audit mode without going through the OOBE.
This is my first attempt at this, and I apologize for the length of this, but I wanted to provide as much information as I could in the hopes of finding a resolution to my issue.
Thanks!
 

My Computer

System One

  • OS
    win 11 22H2
    Computer type
    Laptop
    Manufacturer/Model
    Dell
Hi, I forged a bit around too this year and perhaps I can give you some "tipps".

First. It seems that not everything you change in audit mode is copyed over with copy profile.

That is why I do the following.

Install Windows... wait for OOBE Screen to appear, boot in Audit Mode (SHIFT+F3) on a virtual machine.

I dont change anything in Settings.
I just install all updates and the Software that I dont want to completely install everytime.
Even if a script / .batch that uses winget installs everything on its own.
Office takes like 20-30 Minutes for me.
I like the system to be ready to go after 10 Minutes installing from my Stick.

That said, I install Office 2016 + all Office Updates.

You can install most Software here allready. Even VLC / 7zip whatever.
But keep in mind. Those install very quick and are mostly outdated quick.
Office just gets Updates from Windows Update if you enable get Updates for other MS products.

I also use the following.

In your "sources" folder, where the install.wim is create a folder named:

$OEM$
in that folder put those two folders
$$
$1

everything in $$ is copyed over to the Windows folder during installation
everything in $1 is copyed over to C:

in $OEM$\$$\Setup\Scripts\
you can create a file "SetupComplete.cmd" .. it is run during the Windows installation.

in that file I call 2 .bat files

one that sets registry tweaks
one that uninstalls Windows Apps that I dont want to have


this could be the setupcomplete.cmd

call %systemdrive%\temp\removedApps.bat
call %systemdrive%\temp\Win11regs.bat


this two .bat files are also in my sources folder
in $OEM$\$1\temp\

The first one contains:
powershell "Remove-AppxPackage -AllUsers -Package Microsoft.BingNews_4.2.27001.0_neutral_~_8wekyb3d8bbwe
powershell "Remove-AppxPackage -AllUsers -Package Microsoft.BingWeather_4.53.33420.0_neutral_~_8wekyb3d8bbwe
and several more


The second one the registry tweaks like the more pinned apps you want

:: More pinned Apps Startmenu
REG ADD "HKLM\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "Start_Layout" /t REG_DWORD /d "1" /f
and many more


Some registry Tweaks go to "HKEY Current User". And you are working with copy profil. You can do the following.
___
in the above .bat file

REG LOAD HKLM\Default %systemdrive%\Users\Default\NTUSER.DAT

instead of HKCU a regTweak now uses "HKLM\Default\" .. that will go to the Default user hive and everything is copyed over because of "copy profile"


Here an example for Clipboard History

:: Clipboard History (ON)
REG ADD "HKLM\Default\SOFTWARE\Microsoft\Clipboard" /v "EnableClipboardHistory" /t REG_DWORD /d "1" /f

at the end of the .batch file you put

REG UNLOAD HKLM\Default


For me that is the best way. Because I can change the .bat files in my "sources\$OEM$\" folder and do not have to change things in Audit Mode and capture a new image.


as an extra Tipp: you can put a folder named $WinpeDriver$ in the root of your install stick.
All drivers are copyed over to PE and the final install.


Now one thing that I use is missing.
You are talking about moving the Startmenu to the left.

that would be
reg add "HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarAl" /t REG_DWORD /d "0" /f
or in the above sample .batch to the default users hive
reg add "HKLM\Default\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarAl" /t REG_DWORD /d "0" /f

BUT it will not work. Why ? I dont know. There are some other things I want to have that dont work like removing that new context menu when clicking the right mouse button.

This is why I use this.

In my $OEM$ folder is the following

$OEM$\$1\users\default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
runonce.bat

that .bat contains HKCU registry Tweaks that are not taken over from copy profile or perhaps get overwritten ? I dont know.
For me that are only like mentioned above "new Context Menu" and Switch Taskbar Windows Icon to the left side.

I also set my PowerConfig settings here.

just put this at the end of that .bat file

del %0

this will delete the .bat file from the autostart.
Else it would run everytime.

with del %0 it is just copyed over from defaultuser to every new user you create and is run once the users logs in the first time.

I hope I could help you a tiny bit.
 
Last edited:

My Computer

System One

  • OS
    Windows 10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom
    CPU
    Ryzen 7 5700X
    Motherboard
    Gigabyte B550 Aorus Elite V2
    Memory
    2 x 16 GB DDR 4 - 3200 - G.Skill RipJaws V
    Graphics Card(s)
    ASUS TUF Gaming GeForce RTX 4070
    Sound Card
    OnBoard Realtek
    Monitor(s) Displays
    2 x Dell S2721DGF
    Screen Resolution
    2560 x 1440 @ 165 MHZ
    Hard Drives
    1 TB Kingston KC3000 M.2PCIe 4.0
    PSU
    be quiet! Pure Power 12 M Modular 80+ Gold
    Case
    Phanteks Eclipse P600s
    Cooling
    be quit! Dark Rock Pro 4
    Keyboard
    Logitech G213 Prodigy
    Mouse
    Logitech G502 Hero
    Internet Speed
    1000 MBit Cable DSL
    Browser
    Firefox
    Antivirus
    Microsoft Defender
For the startmenu.

go to

%LocalAppData%\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState

and copy over the start2.bin
to

USBSTICK:\sources\$OEM$\$1\users\default\AppData\Local\Packages\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\LocalState

just create those folders in $OEM$\$1\ on your setup stick
users
default
AppData
Local
Packages
Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy
LocalState

and put the start2.bin you took from the "Audit" here and the Startmenu Buttons will look like in Audit Mode

NO spotify / linked In stuff
 

My Computer

System One

  • OS
    Windows 10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Custom
    CPU
    Ryzen 7 5700X
    Motherboard
    Gigabyte B550 Aorus Elite V2
    Memory
    2 x 16 GB DDR 4 - 3200 - G.Skill RipJaws V
    Graphics Card(s)
    ASUS TUF Gaming GeForce RTX 4070
    Sound Card
    OnBoard Realtek
    Monitor(s) Displays
    2 x Dell S2721DGF
    Screen Resolution
    2560 x 1440 @ 165 MHZ
    Hard Drives
    1 TB Kingston KC3000 M.2PCIe 4.0
    PSU
    be quiet! Pure Power 12 M Modular 80+ Gold
    Case
    Phanteks Eclipse P600s
    Cooling
    be quit! Dark Rock Pro 4
    Keyboard
    Logitech G213 Prodigy
    Mouse
    Logitech G502 Hero
    Internet Speed
    1000 MBit Cable DSL
    Browser
    Firefox
    Antivirus
    Microsoft Defender
Thanks for the great information!
I will need to figure out how to make some of your step's work for my situation.
I do not use a USB stick.
I capture my image using DISM and then Apply the Image using DISM again from the network.
 

My Computer

System One

  • OS
    win 11 22H2
    Computer type
    Laptop
    Manufacturer/Model
    Dell
Back
Top Bottom