Seite 8 von 14

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

Verfasst: 28.07.2023, 19:36
von Jens1976
@Holgi: Sie haben Post :D

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

Verfasst: 29.07.2023, 06:26
von Scoty
Bei mir ist beim Pfad "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" nichts vorhanden. Kein einziger Eintrag? Und wenn ich mir das Backup anschaue von BackupSML so ist da auch ein ganz anderer Pfad und zwar:
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\CloudStore\Store\Cache\DefaultAccount".

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

Verfasst: 29.07.2023, 08:10
von Jens1976
Viele Wege führen nach Rom. Hier funktioniert es mit diesem Pfad auf jedenfall ;)

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

Verfasst: 29.07.2023, 08:41
von Scoty
Das die Icons nicht gelöscht werden vom Edge ist soweit nun klar aber warum wird OneDrive nicht gelöscht weil der dennoch noch da ist?

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

Verfasst: 29.07.2023, 08:49
von Jens1976
Das ist lediglich nur noch ein Link. Wenn Du da mit der rechten Maustaste draufklickst, kann Du den Speicherort öffnen lassen und die Verlinkung löschen. Is zumindest hier so...

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

Verfasst: 29.07.2023, 08:50
von Scoty
Das weiß ich und wurde schon geklärt. Nur die Sache mit OneDrive ist offen.

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

Verfasst: 29.07.2023, 09:20
von Jens1976
Sorry, aber ich hab keine Ahnung, was Du da veranstaltest. Holgi und ich haben das Script mehrmals in verschiedenen Konstellationen getestet und es hat jedesmal funktioniert. Ich habe keine Ahnung was Du da verändert hast oder auch nicht. Das ist irgendwie wie fischen in trüben Gewässern. Zip Dein Zeugs mal ein und häng es hier an. Ich schau heut ma irgendwann drüber...

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

Verfasst: 29.07.2023, 09:24
von Scoty
Hier meine aktuelle Version.
tiny11builder-main.zip
Die Meldung von Edge löschen kommt und danach sollte OneDrive als nächstes kommen, tut es aber nicht.

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

Verfasst: 29.07.2023, 12:36
von Holgi
Jens1976 hat geschrieben: 28.07.2023, 19:34
Hab ich jetzt mal nicht getestet, aber sollte eigentlich so gehen:

Code: Alles auswählen

reg add "HKLM\SOFTWARE\Microsoft\PolicyManager\current\device\Start" /v "ConfigureStartPins" /t REG_SZ /d "{\"pinnedList\": [{}]}" /f
Der Registry Eintrag hat keine Auswirkungen auf einem laufenden Windows. Schade!

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

Verfasst: 29.07.2023, 13:43
von Holgi
Scoty hat geschrieben: 29.07.2023, 09:24 Hier meine aktuelle Version.
tiny11builder-main.zip

Die Meldung von Edge löschen kommt und danach sollte OneDrive als nächstes kommen, tut es aber nicht.
ich habe das jetzt noch mal nachvollzogen mit einer Windows 11 23H2 (25915.1000). Die Scripte funktionieren soweit.
Mir war noch aufgefallen, dass es zu einem Fehler kommt, wenn die Scripte im %homepath% Ordner ausgeführt werden, der mit Leerzeichen behaftet ist (zum Beispiel C:\Users\Egon Mueller\Downloads).
Deshalb noch mal eine Änderung vorgenommen; es fehlten nur ein paar Anführungszeichen hier und dort.
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

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" /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 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
rem 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 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.

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

hast du die PowerRunX64.exe mit im Ordner und die oscdimg.exe?

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

Verfasst: 29.07.2023, 13:47
von Scoty
Ja beide Dateien sind im Ordner.

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

Verfasst: 29.07.2023, 14:00
von Holgi
Scoty hat geschrieben: 29.07.2023, 13:47 Ja beide Dateien sind im Ordner.
dann kann es eigentlich nur noch am "Ausgangsmaterial" liegen. Welche Windows Version nutzt du dafür? Die sollte unbearbeitet sein!

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

Verfasst: 29.07.2023, 14:01
von Holgi
@Jens1976: Sie haben Post :)

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

Verfasst: 29.07.2023, 14:04
von Scoty
Die aktuelle Beta Build wobei ich hier schon durch die CustomListApp einiges entfernt habe. Erstellte gerade eine ISO ohne das ich was lösche und teste es damit nochmals.

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

Verfasst: 29.07.2023, 14:13
von Scoty
Also mit einer neue ISO kommen nur Fehler im PowerShell Fenster. Habe das neue Script von oben dafür genommen was du angepasst hast. Aber auch mit meinen Script dasselbe.
Screenshot 2023-07-29 141936.png