Seite 9 von 14

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 29.07.2023, 15:07
von Holgi
da sehe ich jetzt aber keine Fehlermeldungen (?!)

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 29.07.2023, 15:09
von Scoty
Es steht überall false und das kann nicht stimmen vor allem steht nichts über eine App die gelöscht wird.

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 29.07.2023, 15:59
von Holgi
bei mir kommt dieses Fenster nicht.
Aber Online False wäre doch richtig, oder? da ja Offline das Image bearbeitet wird.
Und restart needed false ist doch auch korrekt.
Letzlich zählt das Ergebnis, also die Tiny11.iso.
Funzt die immer noch nicht bei dir?

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 29.07.2023, 16:01
von Scoty
Wie du bekommst dieses Fenster nicht? Du nutzt doch das selbe Script daher muss sich bei dir ein PowerShell Fenster öffnen neben dem cmd Fenster?

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 29.07.2023, 16:07
von Holgi
läuft vlt. bei mir im Hintergrund? Zu Gesicht bekomme ich es nicht.

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 29.07.2023, 16:08
von Scoty
Merkwürdig. Sollte nicht so sein.

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 30.07.2023, 11:01
von Holgi
habs noch mal getestet:
das Terminal Fenster minimiert.
Da ist tatsächlich kein PS Fenster, welches sich zwischenzeitlich öffnet (schließt).

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 30.07.2023, 11:02
von Scoty
Dann nutzt du ein anderes Script wieder. Das Original Script macht es ja nur über das cmd. Power Shell kam ja nachträglich hinzu von euch. Oder du führst das ganze in einen Power Shell aus wo dann vielleicht kein zusätzliches Fenster mehr öffnen muss.

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 30.07.2023, 11:19
von Holgi
hier noch mal die beiden Scripte, welche zuletzt benutzt wurden:
tinywin11.cmd

Code: Alles auswählen

COLOR 0a
REM Color 1f
REM 1 Dunkelblau 9 Blau    2 Dunkelgrün  A Grün  3 Blaugrün 	B Zyan 0 Schwarz 	8 Dunkelgrau 4 	Dunkelrot 	C Rot 
REM 5 Lila 	D Magenta 6 Ocker E Gelb 7 Hellgrau 	F Weiß 
REM 1. Wert Hintergrund    2. Wert Textfarbe

@Echo off
:Admin
cls

:: BatchGotAdmin
:-------------------------------------
REM  --> Check for permissions
    IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" (
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system"
) ELSE (
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
)

REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
    echo Requesting administrative privileges...
    goto UACPrompt
) else ( goto gotAdmin )

:UACPrompt
    echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
    set params= %*
    echo UAC.ShellExecute "cmd.exe", "/c ""%~s0"" %params:"=""%", "", "runas", 1 >> "%temp%\getadmin.vbs"

    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"

    exit /B

:gotAdmin
setlocal EnableExtensions EnableDelayedExpansion

title tiny11 builder
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 and packages...

rem start/wait powershell -noprofile -command "&{ start-process powershell -ArgumentList '-noprofile -file %~dp0Apps.ps1' -verb RunAs}"
start/wait PowerShell -NoProfile -ExecutionPolicy Bypass -command "&{ start-process powershell -ArgumentList '-noprofile -file %~dp0Apps.ps1' -verb RunAs}"
timeout /t 150 /nobreak > nul
echo Removing of system apps and packages complete!

cls

rem echo Removing Edge:
rem rd "C:\scratchdir\Program Files (x86)\Microsoft\Edge" /s /q
rem rd "C:\scratchdir\Program Files (x86)\Microsoft\EdgeUpdate" /s /q
echo Removing OneDrive:
takeown /f "C:\scratchdir\Windows\System32\OneDriveSetup.exe" /A
icacls "C:\scratchdir\Windows\System32\OneDriveSetup.exe" /grant Administratoren: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 Disable device encryption:
Reg add "HKLM\zSYSTEM\ControlSet001\Control\BitLocker" /v "PreventDeviceEncryption" /t REG_DWORD /d "1" /f >nul 2>&1
echo Disable OneDrive Setup:
Reg delete "HKLM\zDEFAULT\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /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
copy /y "%~dp0autounattend.xml" c:\scratchdir\Windows\System32\Sysprep\autounattend.xml
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

call "%~dp0PowerRun_x64.exe" "%~dp0tinywin11_2.cmd"
rem start /wait "%~dp0PowerRun_x64.exe" "%~dp0tinywin11_2.cmd"

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.

if exist c:\tiny11\efi\microsoft\boot\cdboot-prompt.efi goto burn

Ren "c:\tiny11\efi\microsoft\boot\cdboot.efi" "cdboot-prompt.efi"
Ren "c:\tiny11\efi\microsoft\boot\cdboot_noprompt.efi" "cdboot.efi"
Ren "c:\tiny11\efi\microsoft\boot\efisys.bin" "efisys_prompt.bin"
Ren "c:\tiny11\efi\microsoft\boot\efisys_noprompt.bin" "efisys.bin"

:burn

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...
echo Performing Cleanup...
powershell DISM /Cleanup-Mountpoints
powershell DISM /Cleanup-WIM
rd c:\tiny11 /s /q 
rd c:\scratchdir /s /q 

exit

tinywin11_2.cmd

Code: Alles auswählen

reg load HKLM\zSOFTWARE "c:\scratchdir\Windows\System32\config\SOFTWARE"
Reg add "HKLM\zSOFTWARE\Microsoft\Windows\CurrentVersion\Communications" /v "ConfigureChatAutoInstall" /t REG_DWORD /d "0" /f
reg unload "HKLM\zSOFTWARE"

exit

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 30.07.2023, 11:24
von Scoty
Hmm komisch das da kein 2. Fenster geöffnet wird. Führst das Script direkt in PowerShell aus oder im CMD?

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 30.07.2023, 11:29
von Holgi
doppelclick tinywin11.cmd. thats´s it.

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 30.07.2023, 11:31
von Scoty
Ok dann ka warum bei mir ein 2. Fenster geöffnet wird im PowerShell. Siehst du im Fenster ob die Sachen entfernt werden wie bei mir mit false?

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 30.07.2023, 11:35
von Holgi
nope!
ich sehe nur "Mounting complete! Performing removal of applications and packages..."
dann tut sich eine Weile nichts.

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 30.07.2023, 11:45
von Scoty
Jetzt weiß ich warum OneDrive nicht gelöscht wird bei mir. Man sieht einen Error aber nur ganz kurz:
Screenshot 2023-07-30 114446.png
Es wird aber mit Admin Rechten ausgeführt.

Re: Vorstellung: tiny11builder; Script zur Verschlankung von Windows 11

Verfasst: 30.07.2023, 11:46
von Holgi
weiß jemand, warum man den Microsoft.XboxIdentityProvider nicht aus dem Image entfernen kann?
Der taucht ja so erst mal in der Apps.ps1 nicht auf.
Setzt man ihn mit auf die Liste, hat das aber auch keine Auswirkungen. Jedenfall nicht in der 25915.1000.
Einige behaupten ja, der sei für irgendetwas nütze. Aber wofür?
Wenn ich den Microsoft.XboxIdentityProvider nachträglich manuell entferne, läuft das System weiterhin stabil.

Nächste Frage:
in der tinywin11.cmd gibt es die Zeile:

Code: Alles auswählen

copy /y "%~dp0autounattend.xml" c:\scratchdir\Windows\System32\Sysprep\autounattend.xml
was bewirkt die eigentlich?
Für eine unattend-Installation ist doch nur die Zeile

Code: Alles auswählen

copy /y "%~dp0autounattend.xml" "C:\tiny11\autounattend.xml"
ausschlaggebend, oder?