mirror of
https://github.com/ntdevlabs/tiny11builder.git
synced 2025-09-16 22:18:03 +02:00
Compare commits
83 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
00e7d8a151 | ||
![]() |
af06d5ab57 | ||
![]() |
b8cd6e9003 | ||
![]() |
44da0a4b4a | ||
![]() |
4a24bff48b | ||
![]() |
a3bb93e0d9 | ||
![]() |
e5752915f6 | ||
![]() |
bde07ab406 | ||
![]() |
ecd3c8310e | ||
![]() |
977c06ae18 | ||
![]() |
6584d2f432 | ||
![]() |
13b88eeea7 | ||
![]() |
35aa44d4e3 | ||
![]() |
88c058a383 | ||
![]() |
cc7e53647e | ||
![]() |
ca2f2dff7e | ||
![]() |
9af52a8206 | ||
![]() |
5da84b9737 | ||
![]() |
af69a48265 | ||
![]() |
1175178bf6 | ||
![]() |
9ca84542f3 | ||
![]() |
71e1e30e5e | ||
![]() |
9b70166776 | ||
![]() |
8c1a8d1045 | ||
![]() |
5ca27c740e | ||
![]() |
a5a4d97994 | ||
![]() |
d53ba61bd4 | ||
![]() |
3ef0c7efd9 | ||
![]() |
bba078c34b | ||
![]() |
1fe45e2e80 | ||
![]() |
233b6b0fc4 | ||
![]() |
5153812f23 | ||
![]() |
48714d253f | ||
![]() |
7ec6a7c253 | ||
![]() |
9d9e51758a | ||
![]() |
e51044f5af | ||
![]() |
af2e6159d0 | ||
![]() |
eeb3c580e2 | ||
![]() |
427e6af437 | ||
![]() |
fb59b449b2 | ||
![]() |
cd8b9a74f4 | ||
![]() |
27a7f54e6a | ||
![]() |
8f43660267 | ||
![]() |
e618386dbd | ||
![]() |
47ef9128b8 | ||
![]() |
f762e66aff | ||
![]() |
5dc7bdce49 | ||
![]() |
218e141897 | ||
![]() |
08eb2ff741 | ||
![]() |
e8327ffa5f | ||
![]() |
d33975d91b | ||
![]() |
d475687923 | ||
![]() |
d014d0119e | ||
![]() |
8158c07cd9 | ||
![]() |
fd1aa7dd61 | ||
![]() |
dbaa1db7a9 | ||
![]() |
501e10c1ad | ||
![]() |
93eb664e56 | ||
![]() |
dcb2c27332 | ||
![]() |
77c74f524d | ||
![]() |
b277eb1019 | ||
![]() |
aa81dfc0d4 | ||
![]() |
98014c0b2a | ||
![]() |
a543bd256d | ||
![]() |
63b44e4e03 | ||
![]() |
4bc8256469 | ||
![]() |
7edad858a8 | ||
![]() |
ef962c2885 | ||
![]() |
d4ae03fe49 | ||
![]() |
4953ad860b | ||
![]() |
62db46658f | ||
![]() |
c91daeadaf | ||
![]() |
643b85f5a6 | ||
![]() |
d2a50a9d69 | ||
![]() |
beab8214d5 | ||
![]() |
3c72acf1f1 | ||
![]() |
c2679204e0 | ||
![]() |
491145ce4c | ||
![]() |
de24916ffc | ||
![]() |
c7001dc2d2 | ||
![]() |
6ce347e6f9 | ||
![]() |
78efe85975 | ||
![]() |
f0a96c7eb3 |
8
.github/FUNDING.yml
vendored
Normal file
8
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
|
||||
github: [ntdevlabs]
|
||||
patreon: [ntdev]
|
||||
ko-fi: [ntdev]
|
||||
|
||||
# Add custom links to support your work
|
||||
custom: ['https://paypal.me/ntdev2']
|
156
README.md
156
README.md
@@ -1,60 +1,122 @@
|
||||
# tiny11builder
|
||||
*Scripts to build a trimmed-down Windows 11 image - now in **PowerShell**!*
|
||||
|
||||
Scripts to build a trimmed-down Windows 11 image.
|
||||
## Introduction :
|
||||
Tiny11 builder, now completely overhauled. <br> After more than a year (for which I am so sorry) of no updates, tiny11 builder is now a much more complete and flexible solution - one script fits all. Also, it is a steppingstone for an even more fleshed-out solution.
|
||||
|
||||
This is a script to automate the build of a streamlined Windows 11 image, similar to tiny11.
|
||||
My main goal is to use only Microsoft utilities like DISM, and nothing external. The only executable included is oscdimg.exe, which is provided in the Windows ADK and it is used to create bootable ISO images. Also included is an unattended answer file, which is used to bypass the MS account on OOBE and to deploy the image with the /compact flag.
|
||||
It's open-source, so feel free to add or remove anything you want! Feedback is also much appreciated.
|
||||
You can now use it on ANY Windows 11 release (not just a specific build), as well as ANY language or architecture.
|
||||
This is made possible thanks to the much-improved scripting capabilities of PowerShell, compared to the older Batch release.
|
||||
|
||||
As of now, only build 22621.525 (the one that can be downloaded from the Microsoft website), 22621.1265 (the latest public build) and 25300 (latest Insider build as of now) are supported.
|
||||
This is a script created to automate the build of a streamlined Windows 11 image, similar to tiny10.
|
||||
The script has also been updated to use DISM's recovery compression, resulting in a much smaller final ISO size, and no utilities from external sources. The only other executable included is **oscdimg.exe**, which is provided in the Windows ADK and it is used to create bootable ISO images.
|
||||
Also included is an unattended answer file, which is used to bypass the Microsoft Account on OOBE and to deploy the image with the `/compact` flag.
|
||||
It's open-source, **so feel free to add or remove anything you want!** Feedback is also much appreciated.
|
||||
|
||||
Instructions:
|
||||
Also, for the very first time, **introducing tiny11 core builder**! A more powerful script, designed for a quick and dirty development testbed. Just the bare minimum, none of the fluff.
|
||||
This script generates a significantly reduced Windows 11 image. However, **it's not suitable for regular use due to its lack of serviceability - you can't add languages, updates, or features post-creation**. tiny11 Core is not a full Windows 11 substitute but a rapid testing or development tool, potentially useful for VM environments.
|
||||
|
||||
1. Download Windows 11 22621.1265 from UUPDump or 22621.525 or 25300 from the Microsoft website (<https://www.microsoft.com/software-download/windows11>)
|
||||
---
|
||||
|
||||
## ⚠️ Script versions:
|
||||
- **tiny11maker.ps1** : The regular script, which removes a lot of bloat but keeps the system serviceable. You can add languages, updates, and features post-creation. This is the recommended script for regular use.
|
||||
- ⚠️ **tiny11coremaker.ps1** : The core script, which removes even more bloat but also removes the ability to service the image. You cannot add languages, updates, or features post-creation. This is recommended for quick testing or development use.
|
||||
|
||||
## Instructions:
|
||||
1. Download Windows 11 from the [Microsoft website](https://www.microsoft.com/software-download/windows11) or [Rufus](https://github.com/pbatard/rufus)
|
||||
2. Mount the downloaded ISO image using Windows Explorer.
|
||||
3. For .1265, run tiny11 creator.bat as administrator. For .525 or 25300, use the aptly-named script (also as administrator).
|
||||
4. Select the drive letter where the image is mounted (only the letter, no colon (:))
|
||||
5. Select the SKU that you want the image to be based.
|
||||
6. Sit back and relax :)
|
||||
7. When the image is completed, you will see it in the folder where the script was extracted, with the name tiny11.iso
|
||||
3. Open **PowerShell 5.1** as Administrator.
|
||||
5. Change the script execution policy :
|
||||
```powershell
|
||||
Set-ExecutionPolicy Bypass -Scope Process
|
||||
```
|
||||
> Using `-Scope Process` you keep your original policy intact as this change only lasts for the current PowerShell session.
|
||||
|
||||
What is removed:
|
||||
Clipchamp,
|
||||
News,
|
||||
Weather,
|
||||
Xbox (although Xbox Identity provider is still here, so it should be possible to be reinstalled with no issues),
|
||||
GetHelp,
|
||||
GetStarted,
|
||||
Office Hub,
|
||||
Solitaire,
|
||||
PeopleApp,
|
||||
PowerAutomate,
|
||||
ToDo,
|
||||
Alarms,
|
||||
Mail and Calendar,
|
||||
Feedback Hub,
|
||||
Maps,
|
||||
Sound Recorder,
|
||||
Your Phone,
|
||||
Media Player,
|
||||
QuickAssist,
|
||||
Internet Explorer,
|
||||
LA57 support,
|
||||
OCR for en-us,
|
||||
Speech support,
|
||||
TTS for en-us,
|
||||
Media Player Legacy,
|
||||
Tablet PC Math,
|
||||
Wallpapers,
|
||||
Edge,
|
||||
OneDrive
|
||||
6. Start the script :
|
||||
```powershell
|
||||
C:/path/to/your/tiny11/script.ps1 -ISO <letter> -SCRATCH <letter>
|
||||
```
|
||||
> You can see of the script by running the `get-help` command.
|
||||
|
||||
Known issues:
|
||||
6. Select the drive letter where the image is mounted (only the letter, no colon (:))
|
||||
7. Select the SKU that you want the image to be based.
|
||||
8. Sit back and relax :)
|
||||
9. When the image is completed, you will see it in the folder where the script was extracted, with the name tiny11.iso
|
||||
|
||||
1. Microsoft Teams (personal) and Cortana are still here. If you find a way to remove them before I find one, feel free to help!
|
||||
2. Although Edge is removed, the icon and a ghost of its taskbar pin are still available. Also, there are some remnants in the Settings. But the app in itself is deleted.
|
||||
3. The script is rather inflexible, as in only the builds specified can be modified. This is because with each new build Microsoft also updates the inbox apps included. If one tries to use other builds, it will work with varying degrees of success, but some things like the removal of Edge and OneDrive as well as bypassing system requirements or other patches will always be applied.
|
||||
4. Only en-us x64 is supported as of now. This can be easily fixable by the end user, just by replacing every instance of en-us with the language needed (like ro-RO and so on), and every x64 instance with arm64.
|
||||
---
|
||||
|
||||
## What is removed:
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Tiny11maker</th>
|
||||
<th>Tiny11coremaker</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li>Clipchamp</li>
|
||||
<li>News</li>
|
||||
<li>Weather</li>
|
||||
<li>Xbox</li>
|
||||
<li>GetHelp</li>
|
||||
<li>GetStarted</li>
|
||||
<li>Office Hub</li>
|
||||
<li>Solitaire</li>
|
||||
<li>PeopleApp</li>
|
||||
<li>PowerAutomate</li>
|
||||
<li>ToDo</li>
|
||||
<li>Alarms</li>
|
||||
<li>Mail and Calendar</li>
|
||||
<li>Feedback Hub</li>
|
||||
<li>Maps</li>
|
||||
<li>Sound Recorder</li>
|
||||
<li>Your Phone</li>
|
||||
<li>Media Player</li>
|
||||
<li>QuickAssist</li>
|
||||
<li>Internet Explorer</li>
|
||||
<li>Tablet PC Math</li>
|
||||
<li>Edge</li>
|
||||
<li>OneDrive</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td>
|
||||
<ul>
|
||||
<li>all from regular tiny +</li>
|
||||
<li>Windows Component Store (WinSxS)</li>
|
||||
<li>Windows Defender (only disabled, can be enabled back if needed)</li>
|
||||
<li>Windows Update (wouldn't work without WinSxS, enabling it would put the system in a state of failure)</li>
|
||||
<li>WinRE</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Keep in mind that **you cannot add back features in tiny11 core**! <br>
|
||||
You will be asked during image creation if you want to enable .net 3.5 support!
|
||||
|
||||
---
|
||||
|
||||
## Known issues:
|
||||
- Although Edge is removed, there are some remnants in the Settings, but the app in itself is deleted.
|
||||
- You might have to update Winget before being able to install any apps, using Microsoft Store.
|
||||
- Outlook and Dev Home might reappear after some time. This is an ongoing battle, though the latest script update tries to prevent this more aggressively.
|
||||
- If you are using this script on arm64, you might see a glimpse of an error while running the script. This is caused by the fact that the arm64 image doesn't have OneDriveSetup.exe included in the System32 folder.
|
||||
|
||||
---
|
||||
|
||||
## Features to be implemented:
|
||||
- ~~disabling telemetry~~ (Implemented in the 04-29-24 release!)
|
||||
- ~~more ad suppression~~ (Partially implemented in the 09-06-25 release!)
|
||||
- improved language and arch detection
|
||||
- more flexibility in what to keep and what to delete
|
||||
- maybe a GUI???
|
||||
|
||||
And that's pretty much it for now!
|
||||
## ❤️ Support the Project
|
||||
|
||||
If this project has helped you, please consider showing your support! A small donation helps me dedicate more time to projects like this.
|
||||
Thank you!
|
||||
|
||||
**[Patreon](http://patreon.com/ntdev) | [PayPal](http://paypal.me/ntdev2) | [Ko-fi](http://ko-fi.com/ntdev)**
|
||||
Thanks for trying it and let me know how you like it!
|
||||
|
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<unattend xmlns="urn:schemas-microsoft-com:unattend">
|
||||
<settings pass="oobeSystem">
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<OOBE>
|
||||
<HideOnlineAccountScreens>true</HideOnlineAccountScreens>
|
||||
</OOBE>
|
||||
</component>
|
||||
</settings>
|
||||
<component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<ConfigureChatAutoInstall>false</ConfigureChatAutoInstall>
|
||||
</component>
|
||||
<settings pass="windowsPE">
|
||||
<component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
|
||||
<DynamicUpdate>
|
||||
<WillShowUI>OnError</WillShowUI>
|
||||
</DynamicUpdate>
|
||||
@@ -29,7 +29,7 @@
|
||||
</ImageInstall>
|
||||
<UserData>
|
||||
<ProductKey>
|
||||
<Key></Key>
|
||||
<Key/>
|
||||
</ProductKey>
|
||||
</UserData>
|
||||
</component>
|
||||
|
BIN
oscdimg.exe
BIN
oscdimg.exe
Binary file not shown.
@@ -1,234 +0,0 @@
|
||||
@echo off
|
||||
setlocal EnableExtensions EnableDelayedExpansion
|
||||
|
||||
title tiny11 builder alpha
|
||||
echo Welcome to the tiny11 image creator!
|
||||
timeout /t 3 /nobreak > nul
|
||||
cls
|
||||
|
||||
set DriveLetter=
|
||||
set /p DriveLetter=Please enter the drive letter for the Windows 11 image:
|
||||
set "DriveLetter=%DriveLetter%:"
|
||||
echo.
|
||||
if not exist "%DriveLetter%\sources\boot.wim" (
|
||||
echo.Can't find Windows OS Installation files in the specified Drive Letter..
|
||||
echo.
|
||||
echo.Please enter the correct DVD Drive Letter..
|
||||
goto :Stop
|
||||
)
|
||||
|
||||
if not exist "%DriveLetter%\sources\install.wim" (
|
||||
echo.Can't find Windows OS Installation files in the specified Drive Letter..
|
||||
echo.
|
||||
echo.Please enter the correct DVD Drive Letter..
|
||||
goto :Stop
|
||||
)
|
||||
md c:\tiny11
|
||||
echo Copying Windows image...
|
||||
xcopy.exe /E /I /H /R /Y /J %DriveLetter% c:\tiny11 >nul
|
||||
echo Copy complete!
|
||||
sleep 2
|
||||
cls
|
||||
echo Getting image information:
|
||||
dism /Get-WimInfo /wimfile:c:\tiny11\sources\install.wim
|
||||
set index=
|
||||
set /p index=Please enter the image index:
|
||||
set "index=%index%"
|
||||
echo Mounting Windows image. This may take a while.
|
||||
echo.
|
||||
md c:\scratchdir
|
||||
dism /mount-image /imagefile:c:\tiny11\sources\install.wim /index:%index% /mountdir:c:\scratchdir
|
||||
echo Mounting complete! Performing removal of applications...
|
||||
echo Removing Clipchamp...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Clipchamp.Clipchamp_2.2.8.0_neutral_~_yxz26nhyzhsrt
|
||||
echo Removing News...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingNews_4.2.27001.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Weather...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingWeather_4.53.33420.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Xbox...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.GamingApp_2021.427.138.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing GetHelp...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.GetHelp_10.2201.421.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing GetStarted...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Getstarted_2021.2204.1.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Office Hub...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.MicrosoftOfficeHub_18.2204.1141.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Solitaire...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.MicrosoftSolitaireCollection_4.12.3171.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing PeopleApp...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.People_2020.901.1724.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing PowerAutomate...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.PowerAutomateDesktop_10.0.3735.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing ToDo...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Todos_2.54.42772.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Alarms...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsAlarms_2022.2202.24.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Mail...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:microsoft.windowscommunicationsapps_16005.14326.20544.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Feedback Hub...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsFeedbackHub_2022.106.2230.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Maps...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsMaps_2022.2202.6.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Sound Recorder...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsSoundRecorder_2021.2103.28.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing XboxTCUI...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Xbox.TCUI_1.23.28004.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing XboxGamingOverlay...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxGamingOverlay_2.622.3232.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing XboxGameOverlay...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxGameOverlay_1.47.2385.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing XboxSpeechToTextOverlay...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxSpeechToTextOverlay_1.17.29001.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Your Phone...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.YourPhone_1.22022.147.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Music...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.ZuneMusic_11.2202.46.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Video...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.ZuneVideo_2019.22020.10021.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Family...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:MicrosoftCorporationII.MicrosoftFamily_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing QuickAssist...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:MicrosoftCorporationII.QuickAssist_2022.414.1758.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Teams...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:MicrosoftTeams_23002.403.1788.1930_x64__8wekyb3d8bbwe
|
||||
echo Removing Cortana...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.549981C3F5F10_4.2204.13303.0_neutral_~_8wekyb3d8bbwe
|
||||
|
||||
echo Removing of system apps complete! Now proceeding to removal of system packages...
|
||||
timeout /t 1 /nobreak > nul
|
||||
cls
|
||||
echo Removing Internet Explorer...
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~amd64~en-US~11.0.22621.1 > nul
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~amd64~~11.0.22621.525 > nul
|
||||
echo Removing LA57:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-Kernel-LA57-FoD-Package~31bf3856ad364e35~amd64~~10.0.22621.525 > nul
|
||||
echo Removing Handwriting:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-Handwriting-en-us-Package~31bf3856ad364e35~amd64~~10.0.22621.525 > nul
|
||||
echo Removing OCR:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-OCR-en-us-Package~31bf3856ad364e35~amd64~~10.0.22621.525 > nul
|
||||
echo Removing Speech:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-Speech-en-us-Package~31bf3856ad364e35~amd64~~10.0.22621.525 > nul
|
||||
echo Removing TTS:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-TextToSpeech-en-us-Package~31bf3856ad364e35~amd64~~10.0.22621.525 > nul
|
||||
echo Removing Media Player Legacy:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~amd64~~10.0.22621.525 > nul
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~wow64~en-US~10.0.22621.1 > nul
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~amd64~~10.0.22621.525 > nul
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~wow64~~10.0.22621.1 > nul
|
||||
echo Removing Tablet PC Math:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-TabletPCMath-Package~31bf3856ad364e35~amd64~~10.0.22621.525 > nul
|
||||
echo Removing Wallpapers:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-Wallpaper-Content-Extended-FoD-Package~31bf3856ad364e35~amd64~~10.0.22621.525 > nul
|
||||
|
||||
echo Removing Edge:
|
||||
rd "C:\scratchdir\Program Files (x86)\Microsoft\Edge" /s /q
|
||||
rd "C:\scratchdir\Program Files (x86)\Microsoft\EdgeUpdate" /s /q
|
||||
echo Removing OneDrive:
|
||||
takeown /f C:\scratchdir\Windows\System32\OneDriveSetup.exe
|
||||
icacls C:\scratchdir\Windows\System32\OneDriveSetup.exe /grant Administrators:F /T /C
|
||||
del /f /q /s "C:\scratchdir\Windows\System32\OneDriveSetup.exe"
|
||||
echo Removal complete!
|
||||
timeout /t 2 /nobreak > nul
|
||||
cls
|
||||
echo Loading registry...
|
||||
reg load HKLM\zCOMPONENTS "c:\scratchdir\Windows\System32\config\COMPONENTS" >nul
|
||||
reg load HKLM\zDEFAULT "c:\scratchdir\Windows\System32\config\default" >nul
|
||||
reg load HKLM\zNTUSER "c:\scratchdir\Users\Default\ntuser.dat" >nul
|
||||
reg load HKLM\zSOFTWARE "c:\scratchdir\Windows\System32\config\SOFTWARE" >nul
|
||||
reg load HKLM\zSYSTEM "c:\scratchdir\Windows\System32\config\SYSTEM" >nul
|
||||
echo Bypassing system requirements(on the system image):
|
||||
Reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
echo Disabling Teams:
|
||||
Reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v "ConfigureChatAutoInstall" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
echo Disabling Sponsored Apps:
|
||||
Reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "OemPreInstalledAppsEnabled" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "PreInstalledAppsEnabled" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SilentInstalledAppsEnabled" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSOFTWARE\Microsoft\PolicyManager\current\device\Start" /v "ConfigureStartPins" /t REG_SZ /d "{\"pinnedList\": [{}]}" /f >nul 2>&1
|
||||
echo Enabling Local Accounts on OOBE:
|
||||
Reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v "BypassNRO" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
copy /y %~dp0autounattend.xml c:\scratchdir\Windows\System32\Sysprep\autounattend.xml
|
||||
echo Disabling Reserved Storage:
|
||||
Reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" /v "ShippedWithReserves" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
echo Disabling Chat icon:
|
||||
Reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat" /v "ChatIcon" /t REG_DWORD /d "3" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
echo Tweaking complete!
|
||||
echo Unmounting Registry...
|
||||
reg unload HKLM\zCOMPONENTS >nul 2>&1
|
||||
reg unload HKLM\zDRIVERS >nul 2>&1
|
||||
reg unload HKLM\zDEFAULT >nul 2>&1
|
||||
reg unload HKLM\zNTUSER >nul 2>&1
|
||||
reg unload HKLM\zSCHEMA >nul 2>&1
|
||||
reg unload HKLM\zSOFTWARE >nul 2>&1
|
||||
reg unload HKLM\zSYSTEM >nul 2>&1
|
||||
echo Cleaning up image...
|
||||
dism /image:c:\scratchdir /Cleanup-Image /StartComponentCleanup /ResetBase
|
||||
echo Cleanup complete.
|
||||
echo Unmounting image...
|
||||
dism /unmount-image /mountdir:c:\scratchdir /commit
|
||||
echo Exporting image...
|
||||
Dism /Export-Image /SourceImageFile:c:\tiny11\sources\install.wim /SourceIndex:%index% /DestinationImageFile:c:\tiny11\sources\install2.wim /compress:max
|
||||
del c:\tiny11\sources\install.wim
|
||||
ren c:\tiny11\sources\install2.wim install.wim
|
||||
echo Windows image completed. Continuing with boot.wim.
|
||||
timeout /t 2 /nobreak > nul
|
||||
cls
|
||||
echo Mounting boot image:
|
||||
dism /mount-image /imagefile:c:\tiny11\sources\boot.wim /index:2 /mountdir:c:\scratchdir
|
||||
echo Loading registry...
|
||||
reg load HKLM\zCOMPONENTS "c:\scratchdir\Windows\System32\config\COMPONENTS" >nul
|
||||
reg load HKLM\zDEFAULT "c:\scratchdir\Windows\System32\config\default" >nul
|
||||
reg load HKLM\zNTUSER "c:\scratchdir\Users\Default\ntuser.dat" >nul
|
||||
reg load HKLM\zSOFTWARE "c:\scratchdir\Windows\System32\config\SOFTWARE" >nul
|
||||
reg load HKLM\zSYSTEM "c:\scratchdir\Windows\System32\config\SYSTEM" >nul
|
||||
echo Bypassing system requirements(on the setup image):
|
||||
Reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
echo Tweaking complete!
|
||||
echo Unmounting Registry...
|
||||
reg unload HKLM\zCOMPONENTS >nul 2>&1
|
||||
reg unload HKLM\zDRIVERS >nul 2>&1
|
||||
reg unload HKLM\zDEFAULT >nul 2>&1
|
||||
reg unload HKLM\zNTUSER >nul 2>&1
|
||||
reg unload HKLM\zSCHEMA >nul 2>&1
|
||||
reg unload HKLM\zSOFTWARE >nul 2>&1
|
||||
reg unload HKLM\zSYSTEM >nul 2>&1
|
||||
echo Unmounting image...
|
||||
dism /unmount-image /mountdir:c:\scratchdir /commit
|
||||
cls
|
||||
echo the tiny11 image is now completed. Proceeding with the making of the ISO...
|
||||
echo Copying unattended file for bypassing MS account on OOBE...
|
||||
copy /y %~dp0autounattend.xml c:\tiny11\autounattend.xml
|
||||
echo.
|
||||
echo Creating ISO image...
|
||||
%~dp0oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,bc:\tiny11\boot\etfsboot.com#pEF,e,bc:\tiny11\efi\microsoft\boot\efisys.bin c:\tiny11 %~dp0tiny11.iso
|
||||
echo Creation completed! Press any key to exit the script...
|
||||
pause
|
||||
echo Performing Cleanup...
|
||||
rd c:\tiny11 /s /q
|
||||
rd c:\scratchdir /s /q
|
||||
exit
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,233 +0,0 @@
|
||||
@echo off
|
||||
setlocal EnableExtensions EnableDelayedExpansion
|
||||
|
||||
title tiny11 builder alpha
|
||||
echo Welcome to the tiny11 image creator!
|
||||
timeout /t 3 /nobreak > nul
|
||||
cls
|
||||
|
||||
set DriveLetter=
|
||||
set /p DriveLetter=Please enter the drive letter for the Windows 11 image:
|
||||
set "DriveLetter=%DriveLetter%:"
|
||||
echo.
|
||||
if not exist "%DriveLetter%\sources\boot.wim" (
|
||||
echo.Can't find Windows OS Installation files in the specified Drive Letter..
|
||||
echo.
|
||||
echo.Please enter the correct DVD Drive Letter..
|
||||
goto :Stop
|
||||
)
|
||||
|
||||
if not exist "%DriveLetter%\sources\install.wim" (
|
||||
echo.Can't find Windows OS Installation files in the specified Drive Letter..
|
||||
echo.
|
||||
echo.Please enter the correct DVD Drive Letter..
|
||||
goto :Stop
|
||||
)
|
||||
md c:\tiny11
|
||||
echo Copying Windows image...
|
||||
xcopy.exe /E /I /H /R /Y /J %DriveLetter% c:\tiny11 >nul
|
||||
echo Copy complete!
|
||||
sleep 2
|
||||
cls
|
||||
echo Getting image information:
|
||||
dism /Get-WimInfo /wimfile:c:\tiny11\sources\install.wim
|
||||
set index=
|
||||
set /p index=Please enter the image index:
|
||||
set "index=%index%"
|
||||
echo Mounting Windows image. This may take a while.
|
||||
echo.
|
||||
md c:\scratchdir
|
||||
dism /mount-image /imagefile:c:\tiny11\sources\install.wim /index:%index% /mountdir:c:\scratchdir
|
||||
echo Mounting complete! Performing removal of applications...
|
||||
echo Removing Clipchamp...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Clipchamp.Clipchamp_2.5.15.0_neutral_~_yxz26nhyzhsrt
|
||||
echo Removing News...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingNews_4.12.21001.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Weather...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingWeather_4.53.50023.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Xbox...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.GamingApp_2021.427.138.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing GetHelp...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.GetHelp_10.2206.2011.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing GetStarted...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Getstarted_2021.2204.1.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Office Hub...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.MicrosoftOfficeHub_18.2204.1141.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Solitaire...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.MicrosoftSolitaireCollection_4.12.3171.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing PeopleApp...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.People_2020.901.1724.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing PowerAutomate...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.PowerAutomateDesktop_10.0.3735.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing ToDo...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Todos_2.54.42772.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Alarms...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsAlarms_2022.2210.9.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Mail...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:microsoft.windowscommunicationsapps_16005.14326.20544.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Feedback Hub...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsFeedbackHub_2022.106.2230.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Maps...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsMaps_2022.2208.6.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Sound Recorder...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsSoundRecorder_2021.2208.27.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing XboxTCUI...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Xbox.TCUI_1.23.28004.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing XboxGamingOverlay...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxGamingOverlay_2.622.3232.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing XboxGameOverlay...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxGameOverlay_1.47.2385.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing XboxSpeechToTextOverlay...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxSpeechToTextOverlay_1.17.29001.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Your Phone...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.YourPhone_1.22022.147.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Music...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.ZuneMusic_11.2210.33.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Video...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.ZuneVideo_2019.22120.10031.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Family...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:MicrosoftCorporationII.MicrosoftFamily_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing QuickAssist...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:MicrosoftCorporationII.QuickAssist_2022.825.2016.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Teams...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:MicrosoftTeams_23002.403.1788.1930_x64__8wekyb3d8bbwe
|
||||
echo Removing Cortana...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.549981C3F5F10_4.2204.13303.0_neutral_~_8wekyb3d8bbwe
|
||||
|
||||
echo Removing of system apps complete! Now proceeding to removal of system packages...
|
||||
timeout /t 1 /nobreak > nul
|
||||
cls
|
||||
echo Removing Internet Explorer...
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~amd64~en-US~11.0.25300.1000 > nul
|
||||
echo Removing LA57:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-Kernel-LA57-FoD-Package~31bf3856ad364e35~amd64~~10.0.25300.1000 > nul
|
||||
echo Removing Handwriting:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-Handwriting-en-us-Package~31bf3856ad364e35~amd64~~10.0.25300.1000 > nul
|
||||
echo Removing OCR:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-OCR-en-us-Package~31bf3856ad364e35~amd64~~10.0.25300.1000 > nul
|
||||
echo Removing Speech:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-Speech-en-us-Package~31bf3856ad364e35~amd64~~10.0.25300.1000 > nul
|
||||
echo Removing TTS:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-TextToSpeech-en-us-Package~31bf3856ad364e35~amd64~~10.0.25300.1000 > nul
|
||||
echo Removing Media Player Legacy:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~amd64~~10.0.25300.1000 > nul
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~wow64~en-US~10.0.25300.1000 > nul
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~amd64~~10.0.25300.1000 > nul
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~wow64~~10.0.25300.1000 > nul
|
||||
echo Removing Tablet PC Math:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-TabletPCMath-Package~31bf3856ad364e35~amd64~~10.0.25300.1000 > nul
|
||||
echo Removing Wallpapers:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-Wallpaper-Content-Extended-FoD-Package~31bf3856ad364e35~amd64~~10.0.25300.1000 > nul
|
||||
|
||||
echo Removing Edge:
|
||||
rd "C:\scratchdir\Program Files (x86)\Microsoft\Edge" /s /q
|
||||
rd "C:\scratchdir\Program Files (x86)\Microsoft\EdgeUpdate" /s /q
|
||||
echo Removing OneDrive:
|
||||
takeown /f C:\scratchdir\Windows\System32\OneDriveSetup.exe
|
||||
icacls C:\scratchdir\Windows\System32\OneDriveSetup.exe /grant Administrators:F /T /C
|
||||
del /f /q /s "C:\scratchdir\Windows\System32\OneDriveSetup.exe"
|
||||
echo Removal complete!
|
||||
timeout /t 2 /nobreak > nul
|
||||
cls
|
||||
echo Loading registry...
|
||||
reg load HKLM\zCOMPONENTS "c:\scratchdir\Windows\System32\config\COMPONENTS" >nul
|
||||
reg load HKLM\zDEFAULT "c:\scratchdir\Windows\System32\config\default" >nul
|
||||
reg load HKLM\zNTUSER "c:\scratchdir\Users\Default\ntuser.dat" >nul
|
||||
reg load HKLM\zSOFTWARE "c:\scratchdir\Windows\System32\config\SOFTWARE" >nul
|
||||
reg load HKLM\zSYSTEM "c:\scratchdir\Windows\System32\config\SYSTEM" >nul
|
||||
echo Bypassing system requirements(on the system image):
|
||||
Reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
echo Disabling Teams:
|
||||
Reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v "ConfigureChatAutoInstall" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
echo Disabling Sponsored Apps:
|
||||
Reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "OemPreInstalledAppsEnabled" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "PreInstalledAppsEnabled" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SilentInstalledAppsEnabled" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSOFTWARE\Microsoft\PolicyManager\current\device\Start" /v "ConfigureStartPins" /t REG_SZ /d "{\"pinnedList\": [{}]}" /f >nul 2>&1
|
||||
echo Enabling Local Accounts on OOBE:
|
||||
Reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v "BypassNRO" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
copy /y %~dp0autounattend.xml c:\scratchdir\Windows\System32\Sysprep\autounattend.xml
|
||||
echo Disabling Reserved Storage:
|
||||
Reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" /v "ShippedWithReserves" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
echo Disabling Chat icon:
|
||||
Reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat" /v "ChatIcon" /t REG_DWORD /d "3" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
echo Tweaking complete!
|
||||
echo Unmounting Registry...
|
||||
reg unload HKLM\zCOMPONENTS >nul 2>&1
|
||||
reg unload HKLM\zDRIVERS >nul 2>&1
|
||||
reg unload HKLM\zDEFAULT >nul 2>&1
|
||||
reg unload HKLM\zNTUSER >nul 2>&1
|
||||
reg unload HKLM\zSCHEMA >nul 2>&1
|
||||
reg unload HKLM\zSOFTWARE >nul 2>&1
|
||||
reg unload HKLM\zSYSTEM >nul 2>&1
|
||||
echo Cleaning up image...
|
||||
dism /image:c:\scratchdir /Cleanup-Image /StartComponentCleanup /ResetBase
|
||||
echo Cleanup complete.
|
||||
echo Unmounting image...
|
||||
dism /unmount-image /mountdir:c:\scratchdir /commit
|
||||
echo Exporting image...
|
||||
Dism /Export-Image /SourceImageFile:c:\tiny11\sources\install.wim /SourceIndex:%index% /DestinationImageFile:c:\tiny11\sources\install2.wim /compress:max
|
||||
del c:\tiny11\sources\install.wim
|
||||
ren c:\tiny11\sources\install2.wim install.wim
|
||||
echo Windows image completed. Continuing with boot.wim.
|
||||
timeout /t 2 /nobreak > nul
|
||||
cls
|
||||
echo Mounting boot image:
|
||||
dism /mount-image /imagefile:c:\tiny11\sources\boot.wim /index:2 /mountdir:c:\scratchdir
|
||||
echo Loading registry...
|
||||
reg load HKLM\zCOMPONENTS "c:\scratchdir\Windows\System32\config\COMPONENTS" >nul
|
||||
reg load HKLM\zDEFAULT "c:\scratchdir\Windows\System32\config\default" >nul
|
||||
reg load HKLM\zNTUSER "c:\scratchdir\Users\Default\ntuser.dat" >nul
|
||||
reg load HKLM\zSOFTWARE "c:\scratchdir\Windows\System32\config\SOFTWARE" >nul
|
||||
reg load HKLM\zSYSTEM "c:\scratchdir\Windows\System32\config\SYSTEM" >nul
|
||||
echo Bypassing system requirements(on the setup image):
|
||||
Reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
echo Tweaking complete!
|
||||
echo Unmounting Registry...
|
||||
reg unload HKLM\zCOMPONENTS >nul 2>&1
|
||||
reg unload HKLM\zDRIVERS >nul 2>&1
|
||||
reg unload HKLM\zDEFAULT >nul 2>&1
|
||||
reg unload HKLM\zNTUSER >nul 2>&1
|
||||
reg unload HKLM\zSCHEMA >nul 2>&1
|
||||
reg unload HKLM\zSOFTWARE >nul 2>&1
|
||||
reg unload HKLM\zSYSTEM >nul 2>&1
|
||||
echo Unmounting image...
|
||||
dism /unmount-image /mountdir:c:\scratchdir /commit
|
||||
cls
|
||||
echo the tiny11 image is now completed. Proceeding with the making of the ISO...
|
||||
echo Copying unattended file for bypassing MS account on OOBE...
|
||||
copy /y %~dp0autounattend.xml c:\tiny11\autounattend.xml
|
||||
echo.
|
||||
echo Creating ISO image...
|
||||
%~dp0oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,bc:\tiny11\boot\etfsboot.com#pEF,e,bc:\tiny11\efi\microsoft\boot\efisys.bin c:\tiny11 %~dp0tiny11.iso
|
||||
echo Creation completed! Press any key to exit the script...
|
||||
pause
|
||||
echo Performing Cleanup...
|
||||
rd c:\tiny11 /s /q
|
||||
rd c:\scratchdir /s /q
|
||||
exit
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,234 +0,0 @@
|
||||
@echo off
|
||||
setlocal EnableExtensions EnableDelayedExpansion
|
||||
|
||||
title tiny11 builder alpha
|
||||
echo Welcome to the tiny11 image creator!
|
||||
timeout /t 3 /nobreak > nul
|
||||
cls
|
||||
|
||||
set DriveLetter=
|
||||
set /p DriveLetter=Please enter the drive letter for the Windows 11 image:
|
||||
set "DriveLetter=%DriveLetter%:"
|
||||
echo.
|
||||
if not exist "%DriveLetter%\sources\boot.wim" (
|
||||
echo.Can't find Windows OS Installation files in the specified Drive Letter..
|
||||
echo.
|
||||
echo.Please enter the correct DVD Drive Letter..
|
||||
goto :Stop
|
||||
)
|
||||
|
||||
if not exist "%DriveLetter%\sources\install.wim" (
|
||||
echo.Can't find Windows OS Installation files in the specified Drive Letter..
|
||||
echo.
|
||||
echo.Please enter the correct DVD Drive Letter..
|
||||
goto :Stop
|
||||
)
|
||||
md c:\tiny11
|
||||
echo Copying Windows image...
|
||||
xcopy.exe /E /I /H /R /Y /J %DriveLetter% c:\tiny11 >nul
|
||||
echo Copy complete!
|
||||
sleep 2
|
||||
cls
|
||||
echo Getting image information:
|
||||
dism /Get-WimInfo /wimfile:c:\tiny11\sources\install.wim
|
||||
set index=
|
||||
set /p index=Please enter the image index:
|
||||
set "index=%index%"
|
||||
echo Mounting Windows image. This may take a while.
|
||||
echo.
|
||||
md c:\scratchdir
|
||||
dism /mount-image /imagefile:c:\tiny11\sources\install.wim /index:%index% /mountdir:c:\scratchdir
|
||||
echo Mounting complete! Performing removal of applications...
|
||||
echo Removing Clipchamp...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Clipchamp.Clipchamp_2.2.8.0_neutral_~_yxz26nhyzhsrt
|
||||
echo Removing News...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingNews_2022.507.446.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Weather...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.BingWeather_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Xbox...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.GamingApp_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing GetHelp...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.GetHelp_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing GetStarted...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Getstarted_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Office Hub...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.MicrosoftOfficeHub_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Solitaire...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.MicrosoftSolitaireCollection_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing PeopleApp...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.People_2022.507.446.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing PowerAutomate...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.PowerAutomateDesktop_2022.507.446.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing ToDo...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Todos_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Alarms...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsAlarms_2022.507.446.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Mail...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:microsoft.windowscommunicationsapps_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Feedback Hub...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsFeedbackHub_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Maps...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsMaps_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Sound Recorder...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.WindowsSoundRecorder_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing XboxTCUI...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.Xbox.TCUI_2022.507.446.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing XboxGamingOverlay...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxGamingOverlay_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing XboxGameOverlay...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxGameOverlay_2022.507.446.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing XboxSpeechToTextOverlay...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.XboxSpeechToTextOverlay_2022.507.446.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Your Phone...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.YourPhone_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Music...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.ZuneMusic_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Video...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.ZuneVideo_2022.507.446.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Family...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:MicrosoftCorporationII.MicrosoftFamily_2022.507.447.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing QuickAssist...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:MicrosoftCorporationII.QuickAssist_2022.507.446.0_neutral_~_8wekyb3d8bbwe
|
||||
echo Removing Teams...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:MicrosoftTeams_23002.403.1788.1930_x64__8wekyb3d8bbwe
|
||||
echo Removing Cortana...
|
||||
dism /image:c:\scratchdir /Remove-ProvisionedAppxPackage /PackageName:Microsoft.549981C3F5F10_4.2204.13303.0_neutral_~_8wekyb3d8bbwe
|
||||
|
||||
echo Removing of system apps complete! Now proceeding to removal of system packages...
|
||||
timeout /t 1 /nobreak > nul
|
||||
cls
|
||||
echo Removing Internet Explorer...
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~amd64~en-US~11.0.22621.1 > nul
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35~amd64~~11.0.22621.1265 > nul
|
||||
echo Removing LA57:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-Kernel-LA57-FoD-Package~31bf3856ad364e35~amd64~~10.0.22621.1265 > nul
|
||||
echo Removing Handwriting:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-Handwriting-en-us-Package~31bf3856ad364e35~amd64~~10.0.22621.1265 > nul
|
||||
echo Removing OCR:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-OCR-en-us-Package~31bf3856ad364e35~amd64~~10.0.22621.1265 > nul
|
||||
echo Removing Speech:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-Speech-en-us-Package~31bf3856ad364e35~amd64~~10.0.22621.1265 > nul
|
||||
echo Removing TTS:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-LanguageFeatures-TextToSpeech-en-us-Package~31bf3856ad364e35~amd64~~10.0.22621.1265 > nul
|
||||
echo Removing Media Player Legacy:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~amd64~~10.0.22621.1265 > nul
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~wow64~en-US~10.0.22621.1 > nul
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~amd64~~10.0.22621.1265 > nul
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35~wow64~~10.0.22621.1 > nul
|
||||
echo Removing Tablet PC Math:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-TabletPCMath-Package~31bf3856ad364e35~amd64~~10.0.22621.1265 > nul
|
||||
echo Removing Wallpapers:
|
||||
dism /image:c:\scratchdir /Remove-Package /PackageName:Microsoft-Windows-Wallpaper-Content-Extended-FoD-Package~31bf3856ad364e35~amd64~~10.0.22621.1265 > nul
|
||||
|
||||
echo Removing Edge:
|
||||
rd "C:\scratchdir\Program Files (x86)\Microsoft\Edge" /s /q
|
||||
rd "C:\scratchdir\Program Files (x86)\Microsoft\EdgeUpdate" /s /q
|
||||
echo Removing OneDrive:
|
||||
takeown /f C:\scratchdir\Windows\System32\OneDriveSetup.exe
|
||||
icacls C:\scratchdir\Windows\System32\OneDriveSetup.exe /grant Administrators:F /T /C
|
||||
del /f /q /s "C:\scratchdir\Windows\System32\OneDriveSetup.exe"
|
||||
echo Removal complete!
|
||||
timeout /t 2 /nobreak > nul
|
||||
cls
|
||||
echo Loading registry...
|
||||
reg load HKLM\zCOMPONENTS "c:\scratchdir\Windows\System32\config\COMPONENTS" >nul
|
||||
reg load HKLM\zDEFAULT "c:\scratchdir\Windows\System32\config\default" >nul
|
||||
reg load HKLM\zNTUSER "c:\scratchdir\Users\Default\ntuser.dat" >nul
|
||||
reg load HKLM\zSOFTWARE "c:\scratchdir\Windows\System32\config\SOFTWARE" >nul
|
||||
reg load HKLM\zSYSTEM "c:\scratchdir\Windows\System32\config\SYSTEM" >nul
|
||||
echo Bypassing system requirements(on the system image):
|
||||
Reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
echo Disabling Teams:
|
||||
Reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v "ConfigureChatAutoInstall" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
echo Disabling Sponsored Apps:
|
||||
Reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "OemPreInstalledAppsEnabled" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "PreInstalledAppsEnabled" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v "SilentInstalledAppsEnabled" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSOFTWARE\Microsoft\PolicyManager\current\device\Start" /v "ConfigureStartPins" /t REG_SZ /d "{\"pinnedList\": [{}]}" /f >nul 2>&1
|
||||
echo Enabling Local Accounts on OOBE:
|
||||
Reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE" /v "BypassNRO" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
copy /y %~dp0autounattend.xml c:\scratchdir\Windows\System32\Sysprep\autounattend.xml
|
||||
echo Disabling Reserved Storage:
|
||||
Reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager" /v "ShippedWithReserves" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
echo Disabling Chat icon:
|
||||
Reg add "HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat" /v "ChatIcon" /t REG_DWORD /d "3" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v "TaskbarMn" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
echo Tweaking complete!
|
||||
echo Unmounting Registry...
|
||||
reg unload HKLM\zCOMPONENTS >nul 2>&1
|
||||
reg unload HKLM\zDRIVERS >nul 2>&1
|
||||
reg unload HKLM\zDEFAULT >nul 2>&1
|
||||
reg unload HKLM\zNTUSER >nul 2>&1
|
||||
reg unload HKLM\zSCHEMA >nul 2>&1
|
||||
reg unload HKLM\zSOFTWARE >nul 2>&1
|
||||
reg unload HKLM\zSYSTEM >nul 2>&1
|
||||
echo Cleaning up image...
|
||||
dism /image:c:\scratchdir /Cleanup-Image /StartComponentCleanup /ResetBase
|
||||
echo Cleanup complete.
|
||||
echo Unmounting image...
|
||||
dism /unmount-image /mountdir:c:\scratchdir /commit
|
||||
echo Exporting image...
|
||||
Dism /Export-Image /SourceImageFile:c:\tiny11\sources\install.wim /SourceIndex:%index% /DestinationImageFile:c:\tiny11\sources\install2.wim /compress:max
|
||||
del c:\tiny11\sources\install.wim
|
||||
ren c:\tiny11\sources\install2.wim install.wim
|
||||
echo Windows image completed. Continuing with boot.wim.
|
||||
timeout /t 2 /nobreak > nul
|
||||
cls
|
||||
echo Mounting boot image:
|
||||
dism /mount-image /imagefile:c:\tiny11\sources\boot.wim /index:2 /mountdir:c:\scratchdir
|
||||
echo Loading registry...
|
||||
reg load HKLM\zCOMPONENTS "c:\scratchdir\Windows\System32\config\COMPONENTS" >nul
|
||||
reg load HKLM\zDEFAULT "c:\scratchdir\Windows\System32\config\default" >nul
|
||||
reg load HKLM\zNTUSER "c:\scratchdir\Users\Default\ntuser.dat" >nul
|
||||
reg load HKLM\zSOFTWARE "c:\scratchdir\Windows\System32\config\SOFTWARE" >nul
|
||||
reg load HKLM\zSYSTEM "c:\scratchdir\Windows\System32\config\SYSTEM" >nul
|
||||
echo Bypassing system requirements(on the setup image):
|
||||
Reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV1" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache" /v "SV2" /t REG_DWORD /d "0" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassCPUCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassRAMCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassSecureBootCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassStorageCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\LabConfig" /v "BypassTPMCheck" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
Reg add "HKLM\zSYSTEM\Setup\MoSetup" /v "AllowUpgradesWithUnsupportedTPMOrCPU" /t REG_DWORD /d "1" /f >nul 2>&1
|
||||
echo Tweaking complete!
|
||||
echo Unmounting Registry...
|
||||
reg unload HKLM\zCOMPONENTS >nul 2>&1
|
||||
reg unload HKLM\zDRIVERS >nul 2>&1
|
||||
reg unload HKLM\zDEFAULT >nul 2>&1
|
||||
reg unload HKLM\zNTUSER >nul 2>&1
|
||||
reg unload HKLM\zSCHEMA >nul 2>&1
|
||||
reg unload HKLM\zSOFTWARE >nul 2>&1
|
||||
reg unload HKLM\zSYSTEM >nul 2>&1
|
||||
echo Unmounting image...
|
||||
dism /unmount-image /mountdir:c:\scratchdir /commit
|
||||
cls
|
||||
echo the tiny11 image is now completed. Proceeding with the making of the ISO...
|
||||
echo Copying unattended file for bypassing MS account on OOBE...
|
||||
copy /y %~dp0autounattend.xml c:\tiny11\autounattend.xml
|
||||
echo.
|
||||
echo Creating ISO image...
|
||||
%~dp0oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,bc:\tiny11\boot\etfsboot.com#pEF,e,bc:\tiny11\efi\microsoft\boot\efisys.bin c:\tiny11 %~dp0tiny11.iso
|
||||
echo Creation completed! Press any key to exit the script...
|
||||
pause
|
||||
echo Performing Cleanup...
|
||||
rd c:\tiny11 /s /q
|
||||
rd c:\scratchdir /s /q
|
||||
exit
|
||||
|
||||
|
||||
|
||||
|
||||
|
579
tiny11Coremaker.ps1
Normal file
579
tiny11Coremaker.ps1
Normal file
@@ -0,0 +1,579 @@
|
||||
if ((Get-ExecutionPolicy) -eq 'Restricted') {
|
||||
Write-Host "Your current PowerShell Execution Policy is set to Restricted, which prevents scripts from running. Do you want to change it to RemoteSigned? (yes/no)"
|
||||
$response = Read-Host
|
||||
if ($response -eq 'yes') {
|
||||
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm:$false
|
||||
} else {
|
||||
Write-Host "The script cannot be run without changing the execution policy. Exiting..."
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
# Check and run the script as admin if required
|
||||
$adminSID = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544")
|
||||
$adminGroup = $adminSID.Translate([System.Security.Principal.NTAccount])
|
||||
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
|
||||
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
|
||||
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
|
||||
if (! $myWindowsPrincipal.IsInRole($adminRole))
|
||||
{
|
||||
Write-Host "Restarting Tiny11 image creator as admin in a new window, you can close this one."
|
||||
$newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell";
|
||||
$newProcess.Arguments = $myInvocation.MyCommand.Definition;
|
||||
$newProcess.Verb = "runas";
|
||||
[System.Diagnostics.Process]::Start($newProcess);
|
||||
exit
|
||||
}
|
||||
Start-Transcript -Path "$PSScriptRoot\tiny11.log"
|
||||
# Ask the user for input
|
||||
Write-Host "Welcome to tiny11 core builder! BETA 09-05-25"
|
||||
Write-Host "This script generates a significantly reduced Windows 11 image. However, it's not suitable for regular use due to its lack of serviceability - you can't add languages, updates, or features post-creation. tiny11 Core is not a full Windows 11 substitute but a rapid testing or development tool, potentially useful for VM environments."
|
||||
Write-Host "Do you want to continue? (y/n)"
|
||||
$input = Read-Host
|
||||
|
||||
if ($input -eq 'y') {
|
||||
Write-Host "Off we go..."
|
||||
Start-Sleep -Seconds 3
|
||||
Clear-Host
|
||||
|
||||
$mainOSDrive = $env:SystemDrive
|
||||
$hostArchitecture = $Env:PROCESSOR_ARCHITECTURE
|
||||
New-Item -ItemType Directory -Force -Path "$mainOSDrive\tiny11\sources" >null
|
||||
$DriveLetter = Read-Host "Please enter the drive letter for the Windows 11 image"
|
||||
$DriveLetter = $DriveLetter + ":"
|
||||
|
||||
if ((Test-Path "$DriveLetter\sources\boot.wim") -eq $false -or (Test-Path "$DriveLetter\sources\install.wim") -eq $false) {
|
||||
if ((Test-Path "$DriveLetter\sources\install.esd") -eq $true) {
|
||||
Write-Host "Found install.esd, converting to install.wim..."
|
||||
& 'dism' '/English' "/Get-WimInfo" "/wimfile:$DriveLetter\sources\install.esd"
|
||||
$index = Read-Host "Please enter the image index"
|
||||
Write-Host ' '
|
||||
Write-Host 'Converting install.esd to install.wim. This may take a while...'
|
||||
& 'DISM' /Export-Image /SourceImageFile:"$DriveLetter\sources\install.esd" /SourceIndex:$index /DestinationImageFile:"$mainOSDrive\tiny11\sources\install.wim" /Compress:max /CheckIntegrity
|
||||
} else {
|
||||
Write-Host "Can't find Windows OS Installation files in the specified Drive Letter.."
|
||||
Write-Host "Please enter the correct DVD Drive Letter.."
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Copying Windows image..."
|
||||
Copy-Item -Path "$DriveLetter\*" -Destination "$mainOSDrive\tiny11" -Recurse -Force > null
|
||||
Set-ItemProperty -Path "$mainOSDrive\tiny11\sources\install.esd" -Name IsReadOnly -Value $false > $null 2>&1
|
||||
Remove-Item "$mainOSDrive\tiny11\sources\install.esd" > $null 2>&1
|
||||
Write-Host "Copy complete!"
|
||||
Start-Sleep -Seconds 2
|
||||
Clear-Host
|
||||
Write-Host "Getting image information:"
|
||||
& 'dism' '/English' "/Get-WimInfo" "/wimfile:$mainOSDrive\tiny11\sources\install.wim"
|
||||
$index = Read-Host "Please enter the image index"
|
||||
Write-Host "Mounting Windows image. This may take a while."
|
||||
$wimFilePath = "$($env:SystemDrive)\tiny11\sources\install.wim"
|
||||
& takeown "/F" $wimFilePath
|
||||
& icacls $wimFilePath "/grant" "$($adminGroup.Value):(F)"
|
||||
try {
|
||||
Set-ItemProperty -Path $wimFilePath -Name IsReadOnly -Value $false -ErrorAction Stop
|
||||
} catch {
|
||||
# This block will catch the error and suppress it.
|
||||
}
|
||||
New-Item -ItemType Directory -Force -Path "$mainOSDrive\scratchdir" > $null
|
||||
& dism /English "/mount-image" "/imagefile:$($env:SystemDrive)\tiny11\sources\install.wim" "/index:$index" "/mountdir:$($env:SystemDrive)\scratchdir"
|
||||
|
||||
$imageIntl = & dism /English /Get-Intl "/Image:$($env:SystemDrive)\scratchdir"
|
||||
$languageLine = $imageIntl -split '\n' | Where-Object { $_ -match 'Default system UI language : ([a-zA-Z]{2}-[a-zA-Z]{2})' }
|
||||
|
||||
if ($languageLine) {
|
||||
$languageCode = $Matches[1]
|
||||
Write-Host "Default system UI language code: $languageCode"
|
||||
} else {
|
||||
Write-Host "Default system UI language code not found."
|
||||
}
|
||||
|
||||
$imageInfo = & 'dism' '/English' '/Get-WimInfo' "/wimFile:$($env:SystemDrive)\tiny11\sources\install.wim" "/index:$index"
|
||||
$lines = $imageInfo -split '\r?\n'
|
||||
|
||||
foreach ($line in $lines) {
|
||||
if ($line -like '*Architecture : *') {
|
||||
$architecture = $line -replace 'Architecture : ',''
|
||||
# If the architecture is x64, replace it with amd64
|
||||
if ($architecture -eq 'x64') {
|
||||
$architecture = 'amd64'
|
||||
}
|
||||
Write-Host "Architecture: $architecture"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $architecture) {
|
||||
Write-Host "Architecture information not found."
|
||||
}
|
||||
|
||||
Write-Host "Mounting complete! Performing removal of applications..."
|
||||
|
||||
$packages = & 'dism' '/English' "/image:$($env:SystemDrive)\scratchdir" '/Get-ProvisionedAppxPackages' |
|
||||
ForEach-Object {
|
||||
if ($_ -match 'PackageName : (.*)') {
|
||||
$matches[1]
|
||||
}
|
||||
}
|
||||
$packagePrefixes = 'Clipchamp.Clipchamp_', 'Microsoft.BingNews_', 'Microsoft.BingWeather_', 'Microsoft.GamingApp_', 'Microsoft.GetHelp_', 'Microsoft.Getstarted_', 'Microsoft.MicrosoftOfficeHub_', 'Microsoft.MicrosoftSolitaireCollection_', 'Microsoft.People_', 'Microsoft.PowerAutomateDesktop_', 'Microsoft.Todos_', 'Microsoft.WindowsAlarms_', 'microsoft.windowscommunicationsapps_', 'Microsoft.WindowsFeedbackHub_', 'Microsoft.WindowsMaps_', 'Microsoft.WindowsSoundRecorder_', 'Microsoft.Xbox.TCUI_', 'Microsoft.XboxGamingOverlay_', 'Microsoft.XboxGameOverlay_', 'Microsoft.XboxSpeechToTextOverlay_', 'Microsoft.YourPhone_', 'Microsoft.ZuneMusic_', 'Microsoft.ZuneVideo_', 'MicrosoftCorporationII.MicrosoftFamily_', 'MicrosoftCorporationII.QuickAssist_', 'MicrosoftTeams_', 'Microsoft.549981C3F5F10_', 'Microsoft.Windows.Copilot', 'MSTeams_', 'Microsoft.OutlookForWindows_', 'Microsoft.Windows.Teams_', 'Microsoft.Copilot_'
|
||||
|
||||
$packagesToRemove = $packages | Where-Object {
|
||||
$packageName = $_
|
||||
$packagePrefixes -contains ($packagePrefixes | Where-Object { $packageName -like "$_*" })
|
||||
}
|
||||
foreach ($package in $packagesToRemove) {
|
||||
write-host "Removing $package :"
|
||||
& 'dism' '/English' "/image:$($env:SystemDrive)\scratchdir" '/Remove-ProvisionedAppxPackage' "/PackageName:$package"
|
||||
}
|
||||
|
||||
Write-Host "Removing of system apps complete! Now proceeding to removal of system packages..."
|
||||
Start-Sleep -Seconds 1
|
||||
Clear-Host
|
||||
|
||||
$scratchDir = "$($env:SystemDrive)\scratchdir"
|
||||
$packagePatterns = @(
|
||||
"Microsoft-Windows-InternetExplorer-Optional-Package~31bf3856ad364e35",
|
||||
"Microsoft-Windows-Kernel-LA57-FoD-Package~31bf3856ad364e35~amd64",
|
||||
"Microsoft-Windows-LanguageFeatures-Handwriting-$languageCode-Package~31bf3856ad364e35",
|
||||
"Microsoft-Windows-LanguageFeatures-OCR-$languageCode-Package~31bf3856ad364e35",
|
||||
"Microsoft-Windows-LanguageFeatures-Speech-$languageCode-Package~31bf3856ad364e35",
|
||||
"Microsoft-Windows-LanguageFeatures-TextToSpeech-$languageCode-Package~31bf3856ad364e35",
|
||||
"Microsoft-Windows-MediaPlayer-Package~31bf3856ad364e35",
|
||||
"Microsoft-Windows-Wallpaper-Content-Extended-FoD-Package~31bf3856ad364e35",
|
||||
"Windows-Defender-Client-Package~31bf3856ad364e35~",
|
||||
"Microsoft-Windows-WordPad-FoD-Package~",
|
||||
"Microsoft-Windows-TabletPCMath-Package~",
|
||||
"Microsoft-Windows-StepsRecorder-Package~"
|
||||
|
||||
)
|
||||
|
||||
# Get all packages
|
||||
$allPackages = & dism /image:$scratchDir /Get-Packages /Format:Table
|
||||
$allPackages = $allPackages -split "`n" | Select-Object -Skip 1
|
||||
|
||||
foreach ($packagePattern in $packagePatterns) {
|
||||
# Filter the packages to remove
|
||||
$packagesToRemove = $allPackages | Where-Object { $_ -like "$packagePattern*" }
|
||||
|
||||
foreach ($package in $packagesToRemove) {
|
||||
# Extract the package identity
|
||||
$packageIdentity = ($package -split "\s+")[0]
|
||||
|
||||
Write-Host "Removing $packageIdentity..."
|
||||
& dism /image:$scratchDir /Remove-Package /PackageName:$packageIdentity
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "Do you want to enable .NET 3.5? This cannot be done after the image has been created! (y/n)"
|
||||
$input = Read-Host
|
||||
|
||||
if ($input -eq 'y') {
|
||||
Write-Host "Enabling .NET 3.5..."
|
||||
& 'dism' "/image:$scratchDir" '/enable-feature' '/featurename:NetFX3' '/All' "/source:$($env:SystemDrive)\tiny11\sources\sxs"
|
||||
Write-Host ".NET 3.5 has been enabled."
|
||||
}
|
||||
elseif ($input -eq 'n') {
|
||||
Write-Host "You chose not to enable .NET 3.5. Continuing..."
|
||||
}
|
||||
else {
|
||||
Write-Host "Invalid input. Please enter 'y' to enable .NET 3.5 or 'n' to continue without installing .net 3.5."
|
||||
}
|
||||
Write-Host "Removing Edge:"
|
||||
Remove-Item -Path "$mainOSDrive\scratchdir\Program Files (x86)\Microsoft\Edge" -Recurse -Force >null
|
||||
Remove-Item -Path "$mainOSDrive\scratchdir\Program Files (x86)\Microsoft\EdgeUpdate" -Recurse -Force >null
|
||||
Remove-Item -Path "$mainOSDrive\scratchdir\Program Files (x86)\Microsoft\EdgeCore" -Recurse -Force >null
|
||||
if ($architecture -eq 'amd64') {
|
||||
$folderPath = Get-ChildItem -Path "$mainOSDrive\scratchdir\Windows\WinSxS" -Filter "amd64_microsoft-edge-webview_31bf3856ad364e35*" -Directory | Select-Object -ExpandProperty FullName
|
||||
|
||||
if ($folderPath) {
|
||||
& 'takeown' '/f' $folderPath '/r' >null
|
||||
& icacls $folderPath "/grant" "$($adminGroup.Value):(F)" '/T' '/C' >null
|
||||
Remove-Item -Path $folderPath -Recurse -Force >null
|
||||
} else {
|
||||
Write-Host "Folder not found."
|
||||
}
|
||||
} elseif ($architecture -eq 'arm64') {
|
||||
$folderPath = Get-ChildItem -Path "$mainOSDrive\scratchdir\Windows\WinSxS" -Filter "arm64_microsoft-edge-webview_31bf3856ad364e35*" -Directory | Select-Object -ExpandProperty FullName >null
|
||||
|
||||
if ($folderPath) {
|
||||
& 'takeown' '/f' $folderPath '/r'>null
|
||||
& icacls $folderPath "/grant" "$($adminGroup.Value):(F)" '/T' '/C' >null
|
||||
Remove-Item -Path $folderPath -Recurse -Force >null
|
||||
} else {
|
||||
Write-Host "Folder not found."
|
||||
}
|
||||
} else {
|
||||
Write-Host "Unknown architecture: $architecture"
|
||||
}
|
||||
& 'takeown' '/f' "$mainOSDrive\scratchdir\Windows\System32\Microsoft-Edge-Webview" '/r'
|
||||
& 'icacls' "$mainOSDrive\scratchdir\Windows\System32\Microsoft-Edge-Webview" '/grant' "$($adminGroup.Value):(F)" '/T' '/C'
|
||||
Remove-Item -Path "$mainOSDrive\scratchdir\Windows\System32\Microsoft-Edge-Webview" -Recurse -Force
|
||||
Write-Host "Removing WinRE"
|
||||
& 'takeown' '/f' "$mainOSDrive\scratchdir\Windows\System32\Recovery" '/r'
|
||||
& 'icacls' "$mainOSDrive\scratchdir\Windows\System32\Recovery" '/grant' 'Administrators:F' '/T' '/C'
|
||||
Remove-Item -Path "$mainOSDrive\scratchdir\Windows\System32\Recovery\winre.wim" -Recurse -Force
|
||||
New-Item -Path "$mainOSDrive\scratchdir\Windows\System32\Recovery\winre.wim" -ItemType File -Force
|
||||
Write-Host "Removing OneDrive:"
|
||||
& 'takeown' '/f' "$mainOSDrive\scratchdir\Windows\System32\OneDriveSetup.exe" >null
|
||||
& 'icacls' "$mainOSDrive\scratchdir\Windows\System32\OneDriveSetup.exe" '/grant' "$($adminGroup.Value):(F)" '/T' '/C' >null
|
||||
Remove-Item -Path "$mainOSDrive\scratchdir\Windows\System32\OneDriveSetup.exe" -Force >null
|
||||
Write-Host "Removal complete!"
|
||||
Start-Sleep -Seconds 2
|
||||
Clear-Host
|
||||
Write-Host "Taking ownership of the WinSxS folder. This might take a while..."
|
||||
& 'takeown' '/f' "$mainOSDrive\scratchdir\Windows\WinSxS" '/r'
|
||||
& 'icacls' "$mainOSDrive\scratchdir\Windows\WinSxS" '/grant' "$($adminGroup.Value):(F)" '/T' '/C'
|
||||
Write-host "Complete!"
|
||||
Start-Sleep -Seconds 2
|
||||
Clear-Host
|
||||
Write-Host "Preparing..."
|
||||
$folderPath = Join-Path -Path $mainOSDrive -ChildPath "\scratchdir\Windows\WinSxS_edit"
|
||||
$sourceDirectory = "$mainOSDrive\scratchdir\Windows\WinSxS"
|
||||
$destinationDirectory = "$mainOSDrive\scratchdir\Windows\WinSxS_edit"
|
||||
New-Item -Path $folderPath -ItemType Directory
|
||||
if ($architecture -eq "amd64") {
|
||||
$dirsToCopy = @(
|
||||
"x86_microsoft.windows.common-controls_6595b64144ccf1df_*",
|
||||
"x86_microsoft.windows.gdiplus_6595b64144ccf1df_*",
|
||||
"x86_microsoft.windows.i..utomation.proxystub_6595b64144ccf1df_*",
|
||||
"x86_microsoft.windows.isolationautomation_6595b64144ccf1df_*",
|
||||
"x86_microsoft-windows-s..ngstack-onecorebase_31bf3856ad364e35_*",
|
||||
"x86_microsoft-windows-s..stack-termsrv-extra_31bf3856ad364e35_*",
|
||||
"x86_microsoft-windows-servicingstack_31bf3856ad364e35_*",
|
||||
"x86_microsoft-windows-servicingstack-inetsrv_*",
|
||||
"x86_microsoft-windows-servicingstack-onecore_*",
|
||||
"amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_*",
|
||||
"amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_*",
|
||||
"amd64_microsoft.windows.c..-controls.resources_6595b64144ccf1df_*",
|
||||
"amd64_microsoft.windows.common-controls_6595b64144ccf1df_*",
|
||||
"amd64_microsoft.windows.gdiplus_6595b64144ccf1df_*",
|
||||
"amd64_microsoft.windows.i..utomation.proxystub_6595b64144ccf1df_*",
|
||||
"amd64_microsoft.windows.isolationautomation_6595b64144ccf1df_*",
|
||||
"amd64_microsoft-windows-s..stack-inetsrv-extra_31bf3856ad364e35_*",
|
||||
"amd64_microsoft-windows-s..stack-msg.resources_31bf3856ad364e35_*",
|
||||
"amd64_microsoft-windows-s..stack-termsrv-extra_31bf3856ad364e35_*",
|
||||
"amd64_microsoft-windows-servicingstack_31bf3856ad364e35_*",
|
||||
"amd64_microsoft-windows-servicingstack-inetsrv_31bf3856ad364e35_*",
|
||||
"amd64_microsoft-windows-servicingstack-msg_31bf3856ad364e35_*",
|
||||
"amd64_microsoft-windows-servicingstack-onecore_31bf3856ad364e35_*",
|
||||
"Catalogs",
|
||||
"FileMaps",
|
||||
"Fusion",
|
||||
"InstallTemp",
|
||||
"Manifests",
|
||||
"x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_*",
|
||||
"x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_*",
|
||||
"x86_microsoft.windows.c..-controls.resources_6595b64144ccf1df_*",
|
||||
"x86_microsoft.windows.c..-controls.resources_6595b64144ccf1df_*"
|
||||
)
|
||||
# Copy each directory
|
||||
foreach ($dir in $dirsToCopy) {
|
||||
$sourceDirs = Get-ChildItem -Path $sourceDirectory -Filter $dir -Directory
|
||||
foreach ($sourceDir in $sourceDirs) {
|
||||
$destDir = Join-Path -Path $destinationDirectory -ChildPath $sourceDir.Name
|
||||
Write-Host "Copying $sourceDir.FullName to $destDir"
|
||||
Copy-Item -Path $sourceDir.FullName -Destination $destDir -Recurse -Force
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($architecture -eq "arm64") {
|
||||
# Specify the list of files to copy
|
||||
$dirsToCopy = @(
|
||||
"arm64_microsoft-windows-servicingstack-onecore_31bf3856ad364e35_*",
|
||||
"Catalogs"
|
||||
"FileMaps"
|
||||
"Fusion"
|
||||
"InstallTemp"
|
||||
"Manifests"
|
||||
"SettingsManifests"
|
||||
"Temp"
|
||||
"x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_*"
|
||||
"x86_microsoft.vc90.crt_1fc8b3b9a1e18e3b_*"
|
||||
"x86_microsoft.windows.c..-controls.resources_6595b64144ccf1df_*"
|
||||
"x86_microsoft.windows.common-controls_6595b64144ccf1df_*"
|
||||
"x86_microsoft.windows.gdiplus_6595b64144ccf1df_*"
|
||||
"x86_microsoft.windows.i..utomation.proxystub_6595b64144ccf1df_*"
|
||||
"x86_microsoft.windows.isolationautomation_6595b64144ccf1df_*"
|
||||
"arm_microsoft.windows.c..-controls.resources_6595b64144ccf1df_*"
|
||||
"arm_microsoft.windows.common-controls_6595b64144ccf1df_*"
|
||||
"arm_microsoft.windows.gdiplus_6595b64144ccf1df_*"
|
||||
"arm_microsoft.windows.i..utomation.proxystub_6595b64144ccf1df_*"
|
||||
"arm_microsoft.windows.isolationautomation_6595b64144ccf1df_*"
|
||||
"arm64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_*"
|
||||
"arm64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_*"
|
||||
"arm64_microsoft.windows.c..-controls.resources_6595b64144ccf1df_*"
|
||||
"arm64_microsoft.windows.common-controls_6595b64144ccf1df_*"
|
||||
"arm64_microsoft.windows.gdiplus_6595b64144ccf1df_*"
|
||||
"arm64_microsoft.windows.i..utomation.proxystub_6595b64144ccf1df_*"
|
||||
"arm64_microsoft.windows.isolationautomation_6595b64144ccf1df_*"
|
||||
"arm64_microsoft-windows-servicing-adm_31bf3856ad364e35_*"
|
||||
"arm64_microsoft-windows-servicingcommon_31bf3856ad364e35_*"
|
||||
"arm64_microsoft-windows-servicing-onecore-uapi_31bf3856ad364e35_*"
|
||||
"arm64_microsoft-windows-servicingstack_31bf3856ad364e35_*"
|
||||
"arm64_microsoft-windows-servicingstack-inetsrv_31bf3856ad364e35_*"
|
||||
"arm64_microsoft-windows-servicingstack-msg_31bf3856ad364e35_*"
|
||||
)
|
||||
}
|
||||
foreach ($dir in $dirsToCopy) {
|
||||
$sourceDirs = Get-ChildItem -Path $sourceDirectory -Filter $dir -Directory
|
||||
foreach ($sourceDir in $sourceDirs) {
|
||||
$destDir = Join-Path -Path $destinationDirectory -ChildPath $sourceDir.Name
|
||||
Write-Host "Copying $sourceDir.FullName to $destDir"
|
||||
Copy-Item -Path $sourceDir.FullName -Destination $destDir -Recurse -Force
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Write-Host "Deleting WinSxS. This may take a while..."
|
||||
Remove-Item -Path $mainOSDrive\scratchdir\Windows\WinSxS -Recurse -Force
|
||||
|
||||
Rename-Item -Path $mainOSDrive\scratchdir\Windows\WinSxS_edit -NewName $mainOSDrive\scratchdir\Windows\WinSxS
|
||||
Write-Host "Complete!"
|
||||
|
||||
Write-Host "Loading registry..."
|
||||
reg load HKLM\zCOMPONENTS $ScratchDisk\scratchdir\Windows\System32\config\COMPONENTS | Out-Null
|
||||
reg load HKLM\zDEFAULT $ScratchDisk\scratchdir\Windows\System32\config\default | Out-Null
|
||||
reg load HKLM\zNTUSER $ScratchDisk\scratchdir\Users\Default\ntuser.dat | Out-Null
|
||||
reg load HKLM\zSOFTWARE $ScratchDisk\scratchdir\Windows\System32\config\SOFTWARE | Out-Null
|
||||
reg load HKLM\zSYSTEM $ScratchDisk\scratchdir\Windows\System32\config\SYSTEM | Out-Null
|
||||
Write-Host "Bypassing system requirements(on the system image):"
|
||||
& 'reg' 'add' 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' '/v' 'SV1' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' '/v' 'SV2' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' '/v' 'SV1' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' '/v' 'SV2' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' '/v' 'BypassCPUCheck' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' '/v' 'BypassRAMCheck' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' '/v' 'BypassSecureBootCheck' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' '/v' 'BypassStorageCheck' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' '/v' 'BypassTPMCheck' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\MoSetup' '/v' 'AllowUpgradesWithUnsupportedTPMOrCPU' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
Write-Host "Disabling Sponsored Apps:"
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'OemPreInstalledAppsEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'PreInstalledAppsEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'SilentInstalledAppsEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' '/v' 'DisableWindowsConsumerFeatures' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'ContentDeliveryAllowed' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Microsoft\PolicyManager\current\device\Start' '/v' 'ConfigureStartPins' '/t' 'REG_SZ' '/d' '{"pinnedList": [{}]}' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'ContentDeliveryAllowed' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'ContentDeliveryAllowed' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'FeatureManagementEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'OemPreInstalledAppsEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'PreInstalledAppsEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'PreInstalledAppsEverEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'SilentInstalledAppsEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'SoftLandingEnabled' '/t' 'REG_DWORD' '/d' '0' '/f'| Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'SubscribedContentEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'SubscribedContent-310093Enabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'SubscribedContent-338388Enabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'SubscribedContent-338389Enabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'SubscribedContent-338393Enabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'SubscribedContent-353694Enabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'SubscribedContent-353696Enabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'SubscribedContentEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' '/v' 'SystemPaneSuggestionsEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\PushToInstall' '/v' 'DisablePushToInstall' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\MRT' '/v' 'DontOfferThroughWUAU' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'delete' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\Subscriptions' '/f' | Out-Null
|
||||
& 'reg' 'delete' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\SuggestedApps' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' '/v' 'DisableConsumerAccountStateContent' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' '/v' 'DisableCloudOptimizedContent' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
Write-Host "Enabling Local Accounts on OOBE:"
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE' '/v' 'BypassNRO' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
Copy-Item -Path "$PSScriptRoot\autounattend.xml" -Destination "$ScratchDisk\scratchdir\Windows\System32\Sysprep\autounattend.xml" -Force | Out-Null
|
||||
Write-Host "Disabling Reserved Storage:"
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager' '/v' 'ShippedWithReserves' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
Write-Host "Disabling BitLocker Device Encryption"
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\ControlSet001\Control\BitLocker' '/v' 'PreventDeviceEncryption' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
Write-Host "Disabling Chat icon:"
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat' '/v' 'ChatIcon' '/t' 'REG_DWORD' '/d' '3' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced' '/v' 'TaskbarMn' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
Write-Host "Removing Edge related registries"
|
||||
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge" /f | Out-Null
|
||||
reg delete "HKEY_LOCAL_MACHINE\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update" /f | Out-Null
|
||||
Write-Host "Disabling OneDrive folder backup"
|
||||
& 'reg' 'add' "HKLM\zSOFTWARE\Policies\Microsoft\Windows\OneDrive" '/v' 'DisableFileSyncNGSC' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
Write-Host "Disabling Telemetry:"
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo' '/v' 'Enabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\Privacy' '/v' 'TailoredExperiencesWithDiagnosticDataEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy' '/v' 'HasAccepted' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Input\TIPC' '/v' 'Enabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization' '/v' 'RestrictImplicitInkCollection' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization' '/v' 'RestrictImplicitTextCollection' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization\TrainedDataStore' '/v' 'HarvestContacts' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Software\Microsoft\Personalization\Settings' '/v' 'AcceptedPrivacyPolicy' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\DataCollection' '/v' 'AllowTelemetry' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\ControlSet001\Services\dmwappushservice' '/v' 'Start' '/t' 'REG_DWORD' '/d' '4' '/f' | Out-Null
|
||||
Write-Host "Prevents installation or DevHome and Outlook:"
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\OutlookUpdate' '/v' 'workCompleted' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\DevHomeUpdate' '/v' 'workCompleted' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'delete' 'HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate' '/f' | Out-Null
|
||||
& 'reg' 'delete' 'HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate' '/f' | Out-Null
|
||||
Write-Host "Disabling Copilot"
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsCopilot' '/v' 'TurnOffWindowsCopilot' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Edge' '/v' 'HubsSidebarEnabled' '/t' 'REG_DWORD' '/d' '0' '/f' | Out-Null
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Explorer' '/v' 'DisableSearchBoxSuggestions' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
Write-Host "Prevents installation of Teams:"
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Teams' '/v' 'DisableInstallation' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
Write-Host "Prevent installation of New Outlook":
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Mail' '/v' 'PreventRun' '/t' 'REG_DWORD' '/d' '1' '/f' | Out-Null
|
||||
$tasksPath = "C:\scratchdir\Windows\System32\Tasks"
|
||||
|
||||
Write-Host "Deleting scheduled task definition files..."
|
||||
|
||||
# Application Compatibility Appraiser
|
||||
Remove-Item -Path "$tasksPath\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" -Force -ErrorAction SilentlyContinue
|
||||
|
||||
# Customer Experience Improvement Program (removes the entire folder and all tasks within it)
|
||||
Remove-Item -Path "$tasksPath\Microsoft\Windows\Customer Experience Improvement Program" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
|
||||
# Program Data Updater
|
||||
Remove-Item -Path "$tasksPath\Microsoft\Windows\Application Experience\ProgramDataUpdater" -Force -ErrorAction SilentlyContinue
|
||||
|
||||
# Chkdsk Proxy
|
||||
Remove-Item -Path "$tasksPath\Microsoft\Windows\Chkdsk\Proxy" -Force -ErrorAction SilentlyContinue
|
||||
|
||||
# Windows Error Reporting (QueueReporting)
|
||||
Remove-Item -Path "$tasksPath\Microsoft\Windows\Windows Error Reporting\QueueReporting" -Force -ErrorAction SilentlyContinue
|
||||
|
||||
Write-Host "Task files have been deleted."
|
||||
Write-Host "Disabling Windows Update..."
|
||||
& 'reg' 'add' "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" '/v' 'StopWUPostOOBE1' '/t' 'REG_SZ' '/d' 'net stop wuauserv' '/f'
|
||||
& 'reg' 'add' "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" '/v' 'StopWUPostOOBE2' '/t' 'REG_SZ' '/d' 'sc stop wuauserv' '/f'
|
||||
& 'reg' 'add' "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" '/v' 'StopWUPostOOBE3' '/t' 'REG_SZ' '/d' 'sc config wuauserv start= disabled' '/f'
|
||||
& 'reg' 'add' "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" '/v' 'DisbaleWUPostOOBE1' '/t' 'REG_SZ' '/d' 'reg add HKLM\SYSTEM\CurrentControlSet\Services\wuauserv /v Start /t REG_DWORD /d 4 /f' '/f'
|
||||
& 'reg' 'add' "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" '/v' 'DisbaleWUPostOOBE2' '/t' 'REG_SZ' '/d' 'reg add HKLM\SYSTEM\ControlSet001\Services\wuauserv /v Start /t REG_DWORD /d 4 /f' '/f'
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' '/v' 'DoNotConnectToWindowsUpdateInternetLocations' '/t' 'REG_DWORD' '/d' '1' '/f'
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' '/v' 'DisableWindowsUpdateAccess' '/t' 'REG_DWORD' '/d' '1' '/f'
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' '/v' 'WUServer' '/t' 'REG_SZ' '/d' 'localhost' '/f'
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' '/v' 'WUStatusServer' '/t' 'REG_SZ' '/d' 'localhost' '/f'
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate' '/v' 'UpdateServiceUrlAlternate' '/t' 'REG_SZ' '/d' 'localhost' '/f'
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' '/v' 'UseWUServer' '/t' 'REG_DWORD' '/d' '1' '/f'
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE' '/v' 'DisableOnline' '/t' 'REG_DWORD' '/d' '1' '/f'
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\ControlSet001\Services\wuauserv' '/v' 'Start' '/t' 'REG_DWORD' '/d' '4' '/f'
|
||||
& 'reg' 'delete' 'HKLM\zSYSTEM\ControlSet001\Services\WaaSMedicSVC' '/f'
|
||||
& 'reg' 'delete' 'HKLM\zSYSTEM\ControlSet001\Services\UsoSvc' '/f'
|
||||
& 'reg' 'add' 'HKEY_LOCAL_MACHINE\zSOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU' '/v' 'NoAutoUpdate' '/t' 'REG_DWORD' '/d' '1' '/f'
|
||||
Write-Host "Disabling Windows Defender"
|
||||
# Set registry values for Windows Defender services
|
||||
$servicePaths = @(
|
||||
"WinDefend",
|
||||
"WdNisSvc",
|
||||
"WdNisDrv",
|
||||
"WdFilter",
|
||||
"Sense"
|
||||
)
|
||||
|
||||
foreach ($path in $servicePaths) {
|
||||
Set-ItemProperty -Path "HKLM:\zSYSTEM\ControlSet001\Services\$path" -Name "Start" -Value 4
|
||||
}
|
||||
& 'reg' 'add' 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer' '/v' 'SettingsPageVisibility' '/t' 'REG_SZ' '/d' 'hide:virus;windowsupdate' '/f'
|
||||
Write-Host "Tweaking complete!"
|
||||
Write-Host "Unmounting Registry..."
|
||||
reg unload HKLM\zCOMPONENTS >null
|
||||
reg unload HKLM\zDEFAULT >null
|
||||
reg unload HKLM\zNTUSER >null
|
||||
reg unload HKLM\zSOFTWARE
|
||||
reg unload HKLM\zSYSTEM >null
|
||||
Write-Host "Cleaning up image..."
|
||||
& 'dism' '/English' "/image:$mainOSDrive\scratchdir" '/Cleanup-Image' '/StartComponentCleanup' '/ResetBase' >null
|
||||
Write-Host "Cleanup complete."
|
||||
Write-Host ' '
|
||||
Write-Host "Unmounting image..."
|
||||
& 'dism' '/English' '/unmount-image' "/mountdir:$mainOSDrive\scratchdir" '/commit'
|
||||
Write-Host "Exporting image..."
|
||||
& 'dism' '/English' '/Export-Image' "/SourceImageFile:$mainOSDrive\tiny11\sources\install.wim" "/SourceIndex:$index" "/DestinationImageFile:$mainOSDrive\tiny11\sources\install2.wim" '/compress:max'
|
||||
Remove-Item -Path "$mainOSDrive\tiny11\sources\install.wim" -Force >null
|
||||
Rename-Item -Path "$mainOSDrive\tiny11\sources\install2.wim" -NewName "install.wim" >null
|
||||
Write-Host "Windows image completed. Continuing with boot.wim."
|
||||
Start-Sleep -Seconds 2
|
||||
Clear-Host
|
||||
Write-Host "Mounting boot image:"
|
||||
$wimFilePath = "$($env:SystemDrive)\tiny11\sources\boot.wim"
|
||||
& takeown "/F" $wimFilePath >null
|
||||
& icacls $wimFilePath "/grant" "$($adminGroup.Value):(F)"
|
||||
Set-ItemProperty -Path $wimFilePath -Name IsReadOnly -Value $false
|
||||
& 'dism' '/English' '/mount-image' "/imagefile:$mainOSDrive\tiny11\sources\boot.wim" '/index:2' "/mountdir:$mainOSDrive\scratchdir"
|
||||
Write-Host "Loading registry..."
|
||||
reg load HKLM\zCOMPONENTS $mainOSDrive\scratchdir\Windows\System32\config\COMPONENTS
|
||||
reg load HKLM\zDEFAULT $mainOSDrive\scratchdir\Windows\System32\config\default
|
||||
reg load HKLM\zNTUSER $mainOSDrive\scratchdir\Users\Default\ntuser.dat
|
||||
reg load HKLM\zSOFTWARE $mainOSDrive\scratchdir\Windows\System32\config\SOFTWARE
|
||||
reg load HKLM\zSYSTEM $mainOSDrive\scratchdir\Windows\System32\config\SYSTEM
|
||||
Write-Host "Bypassing system requirements(on the setup image):"
|
||||
& 'reg' 'add' 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' '/v' 'SV1' '/t' 'REG_DWORD' '/d' '0' '/f' >null
|
||||
& 'reg' 'add' 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' '/v' 'SV2' '/t' 'REG_DWORD' '/d' '0' '/f' >null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' '/v' 'SV1' '/t' 'REG_DWORD' '/d' '0' '/f' >null
|
||||
& 'reg' 'add' 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' '/v' 'SV2' '/t' 'REG_DWORD' '/d' '0' '/f' >null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' '/v' 'BypassCPUCheck' '/t' 'REG_DWORD' '/d' '1' '/f' >null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' '/v' 'BypassRAMCheck' '/t' 'REG_DWORD' '/d' '1' '/f' >null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' '/v' 'BypassSecureBootCheck' '/t' 'REG_DWORD' '/d' '1' '/f' >null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' '/v' 'BypassStorageCheck' '/t' 'REG_DWORD' '/d' '1' '/f' >null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\LabConfig' '/v' 'BypassTPMCheck' '/t' 'REG_DWORD' '/d' '1' '/f' >null
|
||||
& 'reg' 'add' 'HKLM\zSYSTEM\Setup\MoSetup' '/v' 'AllowUpgradesWithUnsupportedTPMOrCPU' '/t' 'REG_DWORD' '/d' '1' '/f' >null
|
||||
& 'reg' 'add' 'HKEY_LOCAL_MACHINE\zSYSTEM\Setup' '/v' 'CmdLine' '/t' 'REG_SZ' '/d' 'X:\sources\setup.exe' '/f' >null
|
||||
Write-Host "Tweaking complete!"
|
||||
Write-Host "Unmounting Registry..."
|
||||
reg unload HKLM\zCOMPONENTS >null
|
||||
reg unload HKLM\zDEFAULT >null
|
||||
reg unload HKLM\zNTUSER >null
|
||||
reg unload HKLM\zSOFTWARE >null
|
||||
reg unload HKLM\zSYSTEM >null
|
||||
Write-Host "Unmounting image..."
|
||||
& 'dism' '/English' '/unmount-image' "/mountdir:$mainOSDrive\scratchdir" '/commit'
|
||||
Clear-Host
|
||||
Write-Host "Exporting ESD. This may take a while..."
|
||||
& dism /Export-Image /SourceImageFile:"$mainOSDrive\tiny11\sources\install.wim" /SourceIndex:1 /DestinationImageFile:"$mainOSDrive\tiny11\sources\install.esd" /Compress:recovery
|
||||
Remove-Item "$mainOSDrive\tiny11\sources\install.wim" > $null 2>&1
|
||||
Write-Host "The tiny11 image is now completed. Proceeding with the making of the ISO..."
|
||||
Write-Host "Creating ISO image..."
|
||||
$ADKDepTools = "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\$hostarchitecture\Oscdimg"
|
||||
$localOSCDIMGPath = "$PSScriptRoot\oscdimg.exe"
|
||||
|
||||
if ([System.IO.Directory]::Exists($ADKDepTools)) {
|
||||
Write-Host "Will be using oscdimg.exe from system ADK."
|
||||
$OSCDIMG = "$ADKDepTools\oscdimg.exe"
|
||||
} else {
|
||||
Write-Host "ADK folder not found. Will be using bundled oscdimg.exe."
|
||||
|
||||
|
||||
$url = "https://msdl.microsoft.com/download/symbols/oscdimg.exe/3D44737265000/oscdimg.exe"
|
||||
|
||||
if (-not (Test-Path -Path $localOSCDIMGPath)) {
|
||||
Write-Host "Downloading oscdimg.exe..."
|
||||
Invoke-WebRequest -Uri $url -OutFile $localOSCDIMGPath
|
||||
|
||||
if (Test-Path $localOSCDIMGPath) {
|
||||
Write-Host "oscdimg.exe downloaded successfully."
|
||||
} else {
|
||||
Write-Error "Failed to download oscdimg.exe."
|
||||
exit 1
|
||||
}
|
||||
} else {
|
||||
Write-Host "oscdimg.exe already exists locally."
|
||||
}
|
||||
|
||||
$OSCDIMG = $localOSCDIMGPath
|
||||
}
|
||||
|
||||
& "$OSCDIMG" '-m' '-o' '-u2' '-udfver102' "-bootdata:2#p0,e,b$ScratchDisk\tiny11\boot\etfsboot.com#pEF,e,b$ScratchDisk\tiny11\efi\microsoft\boot\efisys.bin" "$ScratchDisk\tiny11" "$PSScriptRoot\tiny11.iso"
|
||||
|
||||
# Finishing up
|
||||
Write-Host "Creation completed! Press any key to exit the script..."
|
||||
Read-Host "Press Enter to continue"
|
||||
Write-Host "Performing Cleanup..."
|
||||
Remove-Item -Path "$mainOSDrive\tiny11" -Recurse -Force >null
|
||||
Remove-Item -Path "$mainOSDrive\scratchdir" -Recurse -Force >null
|
||||
|
||||
# Stop the transcript
|
||||
Stop-Transcript
|
||||
|
||||
exit
|
||||
}
|
||||
elseif ($input -eq 'n') {
|
||||
Write-Host "You chose not to continue. The script will now exit."
|
||||
exit
|
||||
}
|
||||
else {
|
||||
Write-Host "Invalid input. Please enter 'y' to continue or 'n' to exit."
|
||||
}
|
535
tiny11maker.ps1
Normal file
535
tiny11maker.ps1
Normal file
@@ -0,0 +1,535 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Scripts to build a trimmed-down Windows 11 image.
|
||||
|
||||
.DESCRIPTION
|
||||
This is a script created to automate the build of a streamlined Windows 11 image, similar to tiny10.
|
||||
My main goal is to use only Microsoft utilities like DISM, and no utilities from external sources.
|
||||
The only executable included is oscdimg.exe, which is provided in the Windows ADK and it is used to create bootable ISO images.
|
||||
|
||||
.PARAMETER ISO
|
||||
Drive letter given to the mounted iso (eg: E)
|
||||
|
||||
.PARAMETER SCRATCH
|
||||
Drive letter of the desired scratch disk (eg: D)
|
||||
|
||||
.EXAMPLE
|
||||
.\tiny11maker.ps1 E D
|
||||
.\tiny11maker.ps1 -ISO E -SCRATCH D
|
||||
.\tiny11maker.ps1 -SCRATCH D -ISO E
|
||||
.\tiny11maker.ps1
|
||||
|
||||
*If you ordinal parameters the first one must be the mounted iso. The second is the scratch drive.
|
||||
prefer the use of full named parameter (eg: "-ISO") as you can put in the order you want.
|
||||
|
||||
.NOTES
|
||||
Auteur: ntdevlabs
|
||||
Date: 09-07-25
|
||||
#>
|
||||
|
||||
#---------[ Parameters ]---------#
|
||||
param (
|
||||
[ValidatePattern('^[c-zC-Z]$')][string]$ISO,
|
||||
[ValidatePattern('^[c-zC-Z]$')][string]$SCRATCH
|
||||
)
|
||||
|
||||
if (-not $SCRATCH) {
|
||||
$ScratchDisk = $PSScriptRoot -replace '[\\]+$', ''
|
||||
} else {
|
||||
$ScratchDisk = $SCRATCH + ":"
|
||||
}
|
||||
|
||||
#---------[ Functions ]---------#
|
||||
function Set-RegistryValue {
|
||||
param (
|
||||
[string]$path,
|
||||
[string]$name,
|
||||
[string]$type,
|
||||
[string]$value
|
||||
)
|
||||
try {
|
||||
& 'reg' 'add' $path '/v' $name '/t' $type '/d' $value '/f' | Out-Null
|
||||
Write-Output "Set registry value: $path\$name"
|
||||
} catch {
|
||||
Write-Output "Error setting registry value: $_"
|
||||
}
|
||||
}
|
||||
|
||||
function Remove-RegistryValue {
|
||||
param (
|
||||
[string]$path
|
||||
)
|
||||
try {
|
||||
& 'reg' 'delete' $path '/f' | Out-Null
|
||||
Write-Output "Removed registry value: $path"
|
||||
} catch {
|
||||
Write-Output "Error removing registry value: $_"
|
||||
}
|
||||
}
|
||||
|
||||
#---------[ Execution ]---------#
|
||||
# Check if PowerShell execution is restricted
|
||||
if ((Get-ExecutionPolicy) -eq 'Restricted') {
|
||||
Write-Output "Your current PowerShell Execution Policy is set to Restricted, which prevents scripts from running. Do you want to change it to RemoteSigned? (yes/no)"
|
||||
$response = Read-Host
|
||||
if ($response -eq 'yes') {
|
||||
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Confirm:$false
|
||||
} else {
|
||||
Write-Output "The script cannot be run without changing the execution policy. Exiting..."
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
# Check and run the script as admin if required
|
||||
$adminSID = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-32-544")
|
||||
$adminGroup = $adminSID.Translate([System.Security.Principal.NTAccount])
|
||||
$myWindowsID=[System.Security.Principal.WindowsIdentity]::GetCurrent()
|
||||
$myWindowsPrincipal=new-object System.Security.Principal.WindowsPrincipal($myWindowsID)
|
||||
$adminRole=[System.Security.Principal.WindowsBuiltInRole]::Administrator
|
||||
if (! $myWindowsPrincipal.IsInRole($adminRole))
|
||||
{
|
||||
Write-Output "Restarting Tiny11 image creator as admin in a new window, you can close this one."
|
||||
$newProcess = new-object System.Diagnostics.ProcessStartInfo "PowerShell";
|
||||
$newProcess.Arguments = $myInvocation.MyCommand.Definition;
|
||||
$newProcess.Verb = "runas";
|
||||
[System.Diagnostics.Process]::Start($newProcess);
|
||||
exit
|
||||
}
|
||||
|
||||
if (-not (Test-Path -Path "$PSScriptRoot/autounattend.xml")) {
|
||||
Invoke-RestMethod "https://raw.githubusercontent.com/ntdevlabs/tiny11builder/refs/heads/main/autounattend.xml" -OutFile "$PSScriptRoot/autounattend.xml"
|
||||
}
|
||||
|
||||
# Start the transcript and prepare the window
|
||||
Start-Transcript -Path "$PSScriptRoot\tiny11_$(get-date -f yyyyMMdd_HHmms).log"
|
||||
|
||||
$Host.UI.RawUI.WindowTitle = "Tiny11 image creator"
|
||||
Clear-Host
|
||||
Write-Output "Welcome to the tiny11 image creator! Release: 09-07-25"
|
||||
|
||||
$hostArchitecture = $Env:PROCESSOR_ARCHITECTURE
|
||||
New-Item -ItemType Directory -Force -Path "$ScratchDisk\tiny11\sources" | Out-Null
|
||||
do {
|
||||
if (-not $ISO) {
|
||||
$DriveLetter = Read-Host "Please enter the drive letter for the Windows 11 image"
|
||||
} else {
|
||||
$DriveLetter = $ISO
|
||||
}
|
||||
if ($DriveLetter -match '^[c-zC-Z]$') {
|
||||
$DriveLetter = $DriveLetter + ":"
|
||||
Write-Output "Drive letter set to $DriveLetter"
|
||||
} else {
|
||||
Write-Output "Invalid drive letter. Please enter a letter between C and Z."
|
||||
}
|
||||
} while ($DriveLetter -notmatch '^[c-zC-Z]:$')
|
||||
|
||||
if ((Test-Path "$DriveLetter\sources\boot.wim") -eq $false -or (Test-Path "$DriveLetter\sources\install.wim") -eq $false) {
|
||||
if ((Test-Path "$DriveLetter\sources\install.esd") -eq $true) {
|
||||
Write-Output "Found install.esd, converting to install.wim..."
|
||||
Get-WindowsImage -ImagePath $DriveLetter\sources\install.esd
|
||||
$index = Read-Host "Please enter the image index"
|
||||
Write-Output ' '
|
||||
Write-Output 'Converting install.esd to install.wim. This may take a while...'
|
||||
Export-WindowsImage -SourceImagePath $DriveLetter\sources\install.esd -SourceIndex $index -DestinationImagePath $ScratchDisk\tiny11\sources\install.wim -Compressiontype Maximum -CheckIntegrity
|
||||
} else {
|
||||
Write-Output "Can't find Windows OS Installation files in the specified Drive Letter.."
|
||||
Write-Output "Please enter the correct DVD Drive Letter.."
|
||||
exit
|
||||
}
|
||||
}
|
||||
|
||||
Write-Output "Copying Windows image..."
|
||||
Copy-Item -Path "$DriveLetter\*" -Destination "$ScratchDisk\tiny11" -Recurse -Force | Out-Null
|
||||
Set-ItemProperty -Path "$ScratchDisk\tiny11\sources\install.esd" -Name IsReadOnly -Value $false > $null 2>&1
|
||||
Remove-Item "$ScratchDisk\tiny11\sources\install.esd" > $null 2>&1
|
||||
Write-Output "Copy complete!"
|
||||
Start-Sleep -Seconds 2
|
||||
Clear-Host
|
||||
Write-Output "Getting image information:"
|
||||
$ImagesIndex = (Get-WindowsImage -ImagePath $ScratchDisk\tiny11\sources\install.wim).ImageIndex
|
||||
while ($ImagesIndex -notcontains $index) {
|
||||
Get-WindowsImage -ImagePath $ScratchDisk\tiny11\sources\install.wim
|
||||
$index = Read-Host "Please enter the image index"
|
||||
}
|
||||
Write-Output "Mounting Windows image. This may take a while."
|
||||
$wimFilePath = "$ScratchDisk\tiny11\sources\install.wim"
|
||||
& takeown "/F" $wimFilePath
|
||||
& icacls $wimFilePath "/grant" "$($adminGroup.Value):(F)"
|
||||
try {
|
||||
Set-ItemProperty -Path $wimFilePath -Name IsReadOnly -Value $false -ErrorAction Stop
|
||||
} catch {
|
||||
# This block will catch the error and suppress it.
|
||||
Write-Error "$wimFilePath not found"
|
||||
}
|
||||
New-Item -ItemType Directory -Force -Path "$ScratchDisk\scratchdir" > $null
|
||||
Mount-WindowsImage -ImagePath $ScratchDisk\tiny11\sources\install.wim -Index $index -Path $ScratchDisk\scratchdir
|
||||
|
||||
$imageIntl = & dism /English /Get-Intl "/Image:$($ScratchDisk)\scratchdir"
|
||||
$languageLine = $imageIntl -split '\n' | Where-Object { $_ -match 'Default system UI language : ([a-zA-Z]{2}-[a-zA-Z]{2})' }
|
||||
|
||||
if ($languageLine) {
|
||||
$languageCode = $Matches[1]
|
||||
Write-Output "Default system UI language code: $languageCode"
|
||||
} else {
|
||||
Write-Output "Default system UI language code not found."
|
||||
}
|
||||
|
||||
$imageInfo = & 'dism' '/English' '/Get-WimInfo' "/wimFile:$($ScratchDisk)\tiny11\sources\install.wim" "/index:$index"
|
||||
$lines = $imageInfo -split '\r?\n'
|
||||
|
||||
foreach ($line in $lines) {
|
||||
if ($line -like '*Architecture : *') {
|
||||
$architecture = $line -replace 'Architecture : ',''
|
||||
# If the architecture is x64, replace it with amd64
|
||||
if ($architecture -eq 'x64') {
|
||||
$architecture = 'amd64'
|
||||
}
|
||||
Write-Output "Architecture: $architecture"
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if (-not $architecture) {
|
||||
Write-Output "Architecture information not found."
|
||||
}
|
||||
|
||||
Write-Output "Mounting complete! Performing removal of applications..."
|
||||
|
||||
$packages = & 'dism' '/English' "/image:$($ScratchDisk)\scratchdir" '/Get-ProvisionedAppxPackages' |
|
||||
ForEach-Object {
|
||||
if ($_ -match 'PackageName : (.*)') {
|
||||
$matches[1]
|
||||
}
|
||||
}
|
||||
|
||||
$packagePrefixes = 'AppUp.IntelManagementandSecurityStatus',
|
||||
'Clipchamp.Clipchamp',
|
||||
'DolbyLaboratories.DolbyAccess',
|
||||
'DolbyLaboratories.DolbyDigitalPlusDecoderOEM',
|
||||
'Microsoft.BingNews',
|
||||
'Microsoft.BingSearch',
|
||||
'Microsoft.BingWeather',
|
||||
'Microsoft.Copilot',
|
||||
'Microsoft.Windows.CrossDevice',
|
||||
'Microsoft.GamingApp',
|
||||
'Microsoft.GetHelp',
|
||||
'Microsoft.Getstarted',
|
||||
'Microsoft.Microsoft3DViewer',
|
||||
'Microsoft.MicrosoftOfficeHub',
|
||||
'Microsoft.MicrosoftSolitaireCollection',
|
||||
'Microsoft.MicrosoftStickyNotes',
|
||||
'Microsoft.MixedReality.Portal',
|
||||
'Microsoft.MSPaint',
|
||||
'Microsoft.Office.OneNote',
|
||||
'Microsoft.OfficePushNotificationUtility',
|
||||
'Microsoft.OutlookForWindows',
|
||||
'Microsoft.Paint',
|
||||
'Microsoft.People',
|
||||
'Microsoft.PowerAutomateDesktop',
|
||||
'Microsoft.SkypeApp',
|
||||
'Microsoft.StartExperiencesApp',
|
||||
'Microsoft.Todos',
|
||||
'Microsoft.Wallet',
|
||||
'Microsoft.Windows.DevHome',
|
||||
'Microsoft.Windows.Copilot',
|
||||
'Microsoft.Windows.Teams',
|
||||
'Microsoft.WindowsAlarms',
|
||||
'Microsoft.WindowsCamera',
|
||||
'microsoft.windowscommunicationsapps',
|
||||
'Microsoft.WindowsFeedbackHub',
|
||||
'Microsoft.WindowsMaps',
|
||||
'Microsoft.WindowsSoundRecorder',
|
||||
'Microsoft.WindowsTerminal',
|
||||
'Microsoft.Xbox.TCUI',
|
||||
'Microsoft.XboxApp',
|
||||
'Microsoft.XboxGameOverlay',
|
||||
'Microsoft.XboxGamingOverlay',
|
||||
'Microsoft.XboxIdentityProvider',
|
||||
'Microsoft.XboxSpeechToTextOverlay',
|
||||
'Microsoft.YourPhone',
|
||||
'Microsoft.ZuneMusic',
|
||||
'Microsoft.ZuneVideo',
|
||||
'MicrosoftCorporationII.MicrosoftFamily',
|
||||
'MicrosoftCorporationII.QuickAssist',
|
||||
'MSTeams',
|
||||
'MicrosoftTeams',
|
||||
'Microsoft.WindowsTerminal',
|
||||
'Microsoft.549981C3F5F10'
|
||||
|
||||
$packagesToRemove = $packages | Where-Object {
|
||||
$packageName = $_
|
||||
$packagePrefixes -contains ($packagePrefixes | Where-Object { $packageName -like "*$_*" })
|
||||
}
|
||||
foreach ($package in $packagesToRemove) {
|
||||
& 'dism' '/English' "/image:$($ScratchDisk)\scratchdir" '/Remove-ProvisionedAppxPackage' "/PackageName:$package"
|
||||
}
|
||||
|
||||
Write-Output "Removing Edge:"
|
||||
Remove-Item -Path "$ScratchDisk\scratchdir\Program Files (x86)\Microsoft\Edge" -Recurse -Force | Out-Null
|
||||
Remove-Item -Path "$ScratchDisk\scratchdir\Program Files (x86)\Microsoft\EdgeUpdate" -Recurse -Force | Out-Null
|
||||
Remove-Item -Path "$ScratchDisk\scratchdir\Program Files (x86)\Microsoft\EdgeCore" -Recurse -Force | Out-Null
|
||||
& 'takeown' '/f' "$ScratchDisk\scratchdir\Windows\System32\Microsoft-Edge-Webview" '/r' | Out-Null
|
||||
& 'icacls' "$ScratchDisk\scratchdir\Windows\System32\Microsoft-Edge-Webview" '/grant' "$($adminGroup.Value):(F)" '/T' '/C' | Out-Null
|
||||
Remove-Item -Path "$ScratchDisk\scratchdir\Windows\System32\Microsoft-Edge-Webview" -Recurse -Force | Out-Null
|
||||
Write-Output "Removing OneDrive:"
|
||||
& 'takeown' '/f' "$ScratchDisk\scratchdir\Windows\System32\OneDriveSetup.exe" | Out-Null
|
||||
& 'icacls' "$ScratchDisk\scratchdir\Windows\System32\OneDriveSetup.exe" '/grant' "$($adminGroup.Value):(F)" '/T' '/C' | Out-Null
|
||||
Remove-Item -Path "$ScratchDisk\scratchdir\Windows\System32\OneDriveSetup.exe" -Force | Out-Null
|
||||
Write-Output "Removal complete!"
|
||||
Start-Sleep -Seconds 2
|
||||
Clear-Host
|
||||
Write-Output "Loading registry..."
|
||||
reg load HKLM\zCOMPONENTS $ScratchDisk\scratchdir\Windows\System32\config\COMPONENTS | Out-Null
|
||||
reg load HKLM\zDEFAULT $ScratchDisk\scratchdir\Windows\System32\config\default | Out-Null
|
||||
reg load HKLM\zNTUSER $ScratchDisk\scratchdir\Users\Default\ntuser.dat | Out-Null
|
||||
reg load HKLM\zSOFTWARE $ScratchDisk\scratchdir\Windows\System32\config\SOFTWARE | Out-Null
|
||||
reg load HKLM\zSYSTEM $ScratchDisk\scratchdir\Windows\System32\config\SYSTEM | Out-Null
|
||||
Write-Output "Bypassing system requirements(on the system image):"
|
||||
Set-RegistryValue 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' 'SV1' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' 'SV2' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' 'SV1' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' 'SV2' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassCPUCheck' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassRAMCheck' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassSecureBootCheck' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassStorageCheck' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassTPMCheck' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\Setup\MoSetup' 'AllowUpgradesWithUnsupportedTPMOrCPU' 'REG_DWORD' '1'
|
||||
Write-Output "Disabling Sponsored Apps:"
|
||||
Set-RegistryValue 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'OemPreInstalledAppsEnabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'PreInstalledAppsEnabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SilentInstalledAppsEnabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableWindowsConsumerFeatures' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'ContentDeliveryAllowed' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Microsoft\PolicyManager\current\device\Start' 'ConfigureStartPins' 'REG_SZ' '{"pinnedList": [{}]}'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'FeatureManagementEnabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'PreInstalledAppsEverEnabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SoftLandingEnabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContentEnabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-310093Enabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-338388Enabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-338389Enabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-338393Enabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-353694Enabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SubscribedContent-353696Enabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager' 'SystemPaneSuggestionsEnabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Policies\Microsoft\PushToInstall' 'DisablePushToInstall' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Policies\Microsoft\MRT' 'DontOfferThroughWUAU' 'REG_DWORD' '1'
|
||||
Remove-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\Subscriptions'
|
||||
Remove-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager\SuggestedApps'
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableConsumerAccountStateContent' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\CloudContent' 'DisableCloudOptimizedContent' 'REG_DWORD' '1'
|
||||
Write-Output "Enabling Local Accounts on OOBE:"
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\OOBE' 'BypassNRO' 'REG_DWORD' '1'
|
||||
Copy-Item -Path "$PSScriptRoot\autounattend.xml" -Destination "$ScratchDisk\scratchdir\Windows\System32\Sysprep\autounattend.xml" -Force | Out-Null
|
||||
|
||||
Write-Output "Disabling Reserved Storage:"
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\ReserveManager' 'ShippedWithReserves' 'REG_DWORD' '0'
|
||||
Write-Output "Disabling BitLocker Device Encryption"
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\ControlSet001\Control\BitLocker' 'PreventDeviceEncryption' 'REG_DWORD' '1'
|
||||
Write-Output "Disabling Chat icon:"
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Chat' 'ChatIcon' 'REG_DWORD' '3'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced' 'TaskbarMn' 'REG_DWORD' '0'
|
||||
Write-Output "Removing Edge related registries"
|
||||
Remove-RegistryValue "HKEY_LOCAL_MACHINE\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge"
|
||||
Remove-RegistryValue "HKEY_LOCAL_MACHINE\zSOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft Edge Update"
|
||||
Write-Output "Disabling OneDrive folder backup"
|
||||
Set-RegistryValue "HKLM\zSOFTWARE\Policies\Microsoft\Windows\OneDrive" "DisableFileSyncNGSC" "REG_DWORD" "1"
|
||||
Write-Output "Disabling Telemetry:"
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\AdvertisingInfo' 'Enabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Windows\CurrentVersion\Privacy' 'TailoredExperiencesWithDiagnosticDataEnabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Speech_OneCore\Settings\OnlineSpeechPrivacy' 'HasAccepted' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Input\TIPC' 'Enabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization' 'RestrictImplicitInkCollection' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization' 'RestrictImplicitTextCollection' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\InputPersonalization\TrainedDataStore' 'HarvestContacts' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Software\Microsoft\Personalization\Settings' 'AcceptedPrivacyPolicy' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\DataCollection' 'AllowTelemetry' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\ControlSet001\Services\dmwappushservice' 'Start' 'REG_DWORD' '4'
|
||||
## Prevents installation of DevHome and Outlook
|
||||
Write-Output "Prevents installation of DevHome and Outlook:"
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate' 'workCompleted' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\OutlookUpdate' 'workCompleted' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Orchestrator\UScheduler\DevHomeUpdate' 'workCompleted' 'REG_DWORD' '1'
|
||||
Remove-RegistryValue 'HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\OutlookUpdate'
|
||||
Remove-RegistryValue 'HKLM\zSOFTWARE\Microsoft\WindowsUpdate\Orchestrator\UScheduler_Oobe\DevHomeUpdate'
|
||||
Write-Output "Disabling Copilot"
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\WindowsCopilot' 'TurnOffWindowsCopilot' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Policies\Microsoft\Edge' 'HubsSidebarEnabled' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Explorer' 'DisableSearchBoxSuggestions' 'REG_DWORD' '1'
|
||||
Write-Output "Prevents installation of Teams:"
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Policies\Microsoft\Teams' 'DisableInstallation' 'REG_DWORD' '1'
|
||||
Write-Output "Prevent installation of New Outlook":
|
||||
Set-RegistryValue 'HKLM\zSOFTWARE\Policies\Microsoft\Windows\Windows Mail' 'PreventRun' 'REG_DWORD' '1'
|
||||
|
||||
Write-Host "Deleting scheduled task definition files..."
|
||||
$tasksPath = "$ScratchDisk\scratchdir\Windows\System32\Tasks"
|
||||
|
||||
# Application Compatibility Appraiser
|
||||
Remove-Item -Path "$tasksPath\Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser" -Force -ErrorAction SilentlyContinue
|
||||
|
||||
# Customer Experience Improvement Program (removes the entire folder and all tasks within it)
|
||||
Remove-Item -Path "$tasksPath\Microsoft\Windows\Customer Experience Improvement Program" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
|
||||
# Program Data Updater
|
||||
Remove-Item -Path "$tasksPath\Microsoft\Windows\Application Experience\ProgramDataUpdater" -Force -ErrorAction SilentlyContinue
|
||||
|
||||
# Chkdsk Proxy
|
||||
Remove-Item -Path "$tasksPath\Microsoft\Windows\Chkdsk\Proxy" -Force -ErrorAction SilentlyContinue
|
||||
|
||||
# Windows Error Reporting (QueueReporting)
|
||||
Remove-Item -Path "$tasksPath\Microsoft\Windows\Windows Error Reporting\QueueReporting" -Force -ErrorAction SilentlyContinue
|
||||
Write-Host "Task files have been deleted."
|
||||
Write-Host "Unmounting Registry..."
|
||||
reg unload HKLM\zCOMPONENTS | Out-Null
|
||||
reg unload HKLM\zDEFAULT | Out-Null
|
||||
reg unload HKLM\zNTUSER | Out-Null
|
||||
reg unload HKLM\zSOFTWARE | Out-Null
|
||||
reg unload HKLM\zSYSTEM | Out-Null
|
||||
Write-Output "Cleaning up image..."
|
||||
dism.exe /Image:$ScratchDisk\scratchdir /Cleanup-Image /StartComponentCleanup /ResetBase
|
||||
Write-Output "Cleanup complete."
|
||||
Write-Output ' '
|
||||
Write-Output "Unmounting image..."
|
||||
Dismount-WindowsImage -Path $ScratchDisk\scratchdir -Save
|
||||
Write-Host "Exporting image..."
|
||||
Dism.exe /Export-Image /SourceImageFile:"$ScratchDisk\tiny11\sources\install.wim" /SourceIndex:$index /DestinationImageFile:"$ScratchDisk\tiny11\sources\install2.wim" /Compress:recovery
|
||||
Remove-Item -Path "$ScratchDisk\tiny11\sources\install.wim" -Force | Out-Null
|
||||
Rename-Item -Path "$ScratchDisk\tiny11\sources\install2.wim" -NewName "install.wim" | Out-Null
|
||||
Write-Output "Windows image completed. Continuing with boot.wim."
|
||||
Start-Sleep -Seconds 2
|
||||
Clear-Host
|
||||
Write-Output "Mounting boot image:"
|
||||
$wimFilePath = "$ScratchDisk\tiny11\sources\boot.wim"
|
||||
& takeown "/F" $wimFilePath | Out-Null
|
||||
& icacls $wimFilePath "/grant" "$($adminGroup.Value):(F)"
|
||||
Set-ItemProperty -Path $wimFilePath -Name IsReadOnly -Value $false
|
||||
Mount-WindowsImage -ImagePath $ScratchDisk\tiny11\sources\boot.wim -Index 2 -Path $ScratchDisk\scratchdir
|
||||
Write-Output "Loading registry..."
|
||||
reg load HKLM\zCOMPONENTS $ScratchDisk\scratchdir\Windows\System32\config\COMPONENTS
|
||||
reg load HKLM\zDEFAULT $ScratchDisk\scratchdir\Windows\System32\config\default
|
||||
reg load HKLM\zNTUSER $ScratchDisk\scratchdir\Users\Default\ntuser.dat
|
||||
reg load HKLM\zSOFTWARE $ScratchDisk\scratchdir\Windows\System32\config\SOFTWARE
|
||||
reg load HKLM\zSYSTEM $ScratchDisk\scratchdir\Windows\System32\config\SYSTEM
|
||||
|
||||
Write-Output "Bypassing system requirements(on the setup image):"
|
||||
Set-RegistryValue 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' 'SV1' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zDEFAULT\Control Panel\UnsupportedHardwareNotificationCache' 'SV2' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' 'SV1' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zNTUSER\Control Panel\UnsupportedHardwareNotificationCache' 'SV2' 'REG_DWORD' '0'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassCPUCheck' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassRAMCheck' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassSecureBootCheck' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassStorageCheck' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\Setup\LabConfig' 'BypassTPMCheck' 'REG_DWORD' '1'
|
||||
Set-RegistryValue 'HKLM\zSYSTEM\Setup\MoSetup' 'AllowUpgradesWithUnsupportedTPMOrCPU' 'REG_DWORD' '1'
|
||||
Write-Output "Tweaking complete!"
|
||||
|
||||
Write-Output "Unmounting Registry..."
|
||||
reg unload HKLM\zCOMPONENTS | Out-Null
|
||||
reg unload HKLM\zDEFAULT | Out-Null
|
||||
reg unload HKLM\zNTUSER | Out-Null
|
||||
reg unload HKLM\zSOFTWARE | Out-Null
|
||||
reg unload HKLM\zSYSTEM | Out-Null
|
||||
|
||||
Write-Output "Unmounting image..."
|
||||
Dismount-WindowsImage -Path $ScratchDisk\scratchdir -Save
|
||||
Clear-Host
|
||||
Write-Output "The tiny11 image is now completed. Proceeding with the making of the ISO..."
|
||||
Write-Output "Copying unattended file for bypassing MS account on OOBE..."
|
||||
Copy-Item -Path "$PSScriptRoot\autounattend.xml" -Destination "$ScratchDisk\tiny11\autounattend.xml" -Force | Out-Null
|
||||
Write-Output "Creating ISO image..."
|
||||
$ADKDepTools = "C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\$hostarchitecture\Oscdimg"
|
||||
$localOSCDIMGPath = "$PSScriptRoot\oscdimg.exe"
|
||||
|
||||
if ([System.IO.Directory]::Exists($ADKDepTools)) {
|
||||
Write-Output "Will be using oscdimg.exe from system ADK."
|
||||
$OSCDIMG = "$ADKDepTools\oscdimg.exe"
|
||||
} else {
|
||||
Write-Output "ADK folder not found. Will be using bundled oscdimg.exe."
|
||||
$url = "https://msdl.microsoft.com/download/symbols/oscdimg.exe/3D44737265000/oscdimg.exe"
|
||||
|
||||
if (-not (Test-Path -Path $localOSCDIMGPath)) {
|
||||
Write-Output "Downloading oscdimg.exe..."
|
||||
Invoke-WebRequest -Uri $url -OutFile $localOSCDIMGPath
|
||||
|
||||
if (Test-Path $localOSCDIMGPath) {
|
||||
Write-Output "oscdimg.exe downloaded successfully."
|
||||
} else {
|
||||
Write-Error "Failed to download oscdimg.exe."
|
||||
exit 1
|
||||
}
|
||||
} else {
|
||||
Write-Output "oscdimg.exe already exists locally."
|
||||
}
|
||||
|
||||
$OSCDIMG = $localOSCDIMGPath
|
||||
}
|
||||
|
||||
& "$OSCDIMG" '-m' '-o' '-u2' '-udfver102' "-bootdata:2#p0,e,b$ScratchDisk\tiny11\boot\etfsboot.com#pEF,e,b$ScratchDisk\tiny11\efi\microsoft\boot\efisys.bin" "$ScratchDisk\tiny11" "$PSScriptRoot\tiny11.iso"
|
||||
|
||||
# Finishing up
|
||||
Write-Output "Creation completed! Press any key to exit the script..."
|
||||
Read-Host "Press Enter to continue"
|
||||
Write-Output "Performing Cleanup..."
|
||||
Remove-Item -Path "$ScratchDisk\tiny11" -Recurse -Force | Out-Null
|
||||
Remove-Item -Path "$ScratchDisk\scratchdir" -Recurse -Force | Out-Null
|
||||
Write-Output "Ejecting Iso drive"
|
||||
Get-Volume -DriveLetter $DriveLetter[0] | Get-DiskImage | Dismount-DiskImage
|
||||
Write-Output "Iso drive ejected"
|
||||
Write-Output "Removing oscdimg.exe..."
|
||||
Remove-Item -Path "$PSScriptRoot\oscdimg.exe" -Force -ErrorAction SilentlyContinue
|
||||
Write-Output "Removing autounattend.xml..."
|
||||
Remove-Item -Path "$PSScriptRoot\autounattend.xml" -Force -ErrorAction SilentlyContinue
|
||||
|
||||
Write-Output "Cleanup check :"
|
||||
if (Test-Path -Path "$ScratchDisk\tiny11") {
|
||||
Write-Output "tiny11 folder still exists. Attempting to remove it again..."
|
||||
Remove-Item -Path "$ScratchDisk\tiny11" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
if (Test-Path -Path "$ScratchDisk\tiny11") {
|
||||
Write-Output "Failed to remove tiny11 folder."
|
||||
} else {
|
||||
Write-Output "tiny11 folder removed successfully."
|
||||
}
|
||||
} else {
|
||||
Write-Output "tiny11 folder does not exist. No action needed."
|
||||
}
|
||||
if (Test-Path -Path "$ScratchDisk\scratchdir") {
|
||||
Write-Output "scratchdir folder still exists. Attempting to remove it again..."
|
||||
Remove-Item -Path "$ScratchDisk\scratchdir" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
if (Test-Path -Path "$ScratchDisk\scratchdir") {
|
||||
Write-Output "Failed to remove scratchdir folder."
|
||||
} else {
|
||||
Write-Output "scratchdir folder removed successfully."
|
||||
}
|
||||
} else {
|
||||
Write-Output "scratchdir folder does not exist. No action needed."
|
||||
}
|
||||
if (Test-Path -Path "$PSScriptRoot\oscdimg.exe") {
|
||||
Write-Output "oscdimg.exe still exists. Attempting to remove it again..."
|
||||
Remove-Item -Path "$PSScriptRoot\oscdimg.exe" -Force -ErrorAction SilentlyContinue
|
||||
if (Test-Path -Path "$PSScriptRoot\oscdimg.exe") {
|
||||
Write-Output "Failed to remove oscdimg.exe."
|
||||
} else {
|
||||
Write-Output "oscdimg.exe removed successfully."
|
||||
}
|
||||
} else {
|
||||
Write-Output "oscdimg.exe does not exist. No action needed."
|
||||
}
|
||||
if (Test-Path -Path "$PSScriptRoot\autounattend.xml") {
|
||||
Write-Output "autounattend.xml still exists. Attempting to remove it again..."
|
||||
Remove-Item -Path "$PSScriptRoot\autounattend.xml" -Force -ErrorAction SilentlyContinue
|
||||
if (Test-Path -Path "$PSScriptRoot\autounattend.xml") {
|
||||
Write-Output "Failed to remove autounattend.xml."
|
||||
} else {
|
||||
Write-Output "autounattend.xml removed successfully."
|
||||
}
|
||||
} else {
|
||||
Write-Output "autounattend.xml does not exist. No action needed."
|
||||
}
|
||||
|
||||
# Stop the transcript
|
||||
Stop-Transcript
|
||||
|
||||
exit
|
||||
|
Reference in New Issue
Block a user