von Jens1976 » 27.06.2023, 23:20
@SkaFan: Ich hab Dir mal nen kleines Script erstellt. Dieses setzt einige Registrypfade neu, und deaktiviert das OnedriveSetup. Weiterhin wird die automatische Neuinstallation der Apps verhindert, welche nach dem entfernen normalerweise bei einer Neuinstsallation stattfindet. Sprich, die Apps, die im Vorfeld entfernt wurden, bleiben dann auch weg. Außerdem löscht das Script die OnedriveSetup.exe und integriert Dir gleich das net Framework 3.5. Voraussetzung dafür ist allerdings, das Du nen Windows 10 Installstick angesteckt hast. Die jeweiligen Pfade mußt Du an Deine Gegebenheiten anpassen. Dieses Script bitte als Admin ausführen.
Code: Alles auswählen
dism.exe /Mount-Image /ImageFile:D:\image\install.wim /index:1 /MountDir:D:\work\1
dism.exe /Mount-Image /ImageFile:D:\image\install.wim /index:2 /MountDir:D:\work\2
dism.exe /Mount-Image /ImageFile:D:\image\install.wim /index:3 /MountDir:D:\work\3
dism.exe /Mount-Image /ImageFile:D:\image\install.wim /index:4 /MountDir:D:\work\4
reg load "HKLM\TK_SOFTWARE" "D:\work\1\Windows\System32\config\SOFTWARE"
reg load "HKLM\temp_default_profile" "D:\work\1\Users\Default\ntuser.dat"
reg load "HKLM\TK_SYSTEM" "D:\work\1\Windows\System32\config\SYSTEM"
reg add "HKLM\TK_SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d "1" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v PreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SilentInstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v OemPreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg delete "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f
reg unload "HKLM\TK_SOFTWARE"
reg unload "HKLM\temp_default_profile"
reg unload "HKLM\TK_SYSTEM"
reg load "HKLM\TK_SOFTWARE" "D:\work\2\Windows\System32\config\SOFTWARE"
reg load "HKLM\temp_default_profile" "D:\work\2\Users\Default\ntuser.dat"
reg load "HKLM\TK_SYSTEM" "D:\work\2\Windows\System32\config\SYSTEM"
reg add "HKLM\TK_SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d "1" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v PreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SilentInstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v OemPreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg delete "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f
reg unload "HKLM\TK_SOFTWARE"
reg unload "HKLM\temp_default_profile"
reg unload "HKLM\TK_SYSTEM"
reg load "HKLM\TK_SOFTWARE" "D:\work\3\Windows\System32\config\SOFTWARE"
reg load "HKLM\temp_default_profile" "D:\work\3\Users\Default\ntuser.dat"
reg load "HKLM\TK_SYSTEM" "D:\work\3\Windows\System32\config\SYSTEM"
reg add "HKLM\TK_SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d "1" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v PreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SilentInstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v OemPreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg delete "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f
reg unload "HKLM\TK_SOFTWARE"
reg unload "HKLM\temp_default_profile"
reg unload "HKLM\TK_SYSTEM"
reg load "HKLM\TK_SOFTWARE" "D:\work\4\Windows\System32\config\SOFTWARE"
reg load "HKLM\temp_default_profile" "D:\work\4\Users\Default\ntuser.dat"
reg load "HKLM\TK_SYSTEM" "D:\work\4\Windows\System32\config\SYSTEM"
reg add "HKLM\TK_SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d "1" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v PreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SilentInstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v OemPreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg delete "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f
reg unload "HKLM\TK_SOFTWARE"
reg unload "HKLM\temp_default_profile"
reg unload "HKLM\TK_SYSTEM"
takeown /f D:\work\1\Windows\System32\OneDriveSetup.exe /A
icacls D:\work\1\Windows\System32\OneDriveSetup.exe /grant Administratoren:F /T /C
del /f /q /s "D:\work\1\Windows\System32\OneDriveSetup.exe"
takeown /f D:\work\2\Windows\System32\OneDriveSetup.exe /A
icacls D:\work\2\Windows\System32\OneDriveSetup.exe /grant Administratoren:F /T /C
del /f /q /s "D:\work\2\Windows\System32\OneDriveSetup.exe"
takeown /f D:\work\3\Windows\System32\OneDriveSetup.exe /A
icacls D:\work\3\Windows\System32\OneDriveSetup.exe /grant Administratoren:F /T /C
del /f /q /s "D:\work\3\Windows\System32\OneDriveSetup.exe"
takeown /f D:\work\4\Windows\System32\OneDriveSetup.exe /A
icacls D:\work\4\Windows\System32\OneDriveSetup.exe /grant Administratoren:F /T /C
del /f /q /s "D:\work\4\Windows\System32\OneDriveSetup.exe"
dism.exe /Image:d:\work\1 /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:E:\sources\sxs
dism.exe /Image:d:\work\2 /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:E:\sources\sxs
dism.exe /Image:d:\work\3 /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:E:\sources\sxs
dism.exe /Image:d:\work\3 /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:E:\sources\sxs
dism.exe /Unmount-Image /MountDir:D:\work\1 /commit
dism.exe /Unmount-Image /MountDir:D:\work\2 /commit
dism.exe /Unmount-Image /MountDir:D:\work\3 /commit
dism.exe /Unmount-Image /MountDir:D:\work\4 /commit
Dism.exe /Export-Image /SourceImageFile:d:\image\install.wim /All /DestinationImageFile:d:\image\install2.wim /CheckIntegrity /Compress:maximum
@SkaFan: Ich hab Dir mal nen kleines Script erstellt. Dieses setzt einige Registrypfade neu, und deaktiviert das OnedriveSetup. Weiterhin wird die automatische Neuinstallation der Apps verhindert, welche nach dem entfernen normalerweise bei einer Neuinstsallation stattfindet. Sprich, die Apps, die im Vorfeld entfernt wurden, bleiben dann auch weg. Außerdem löscht das Script die OnedriveSetup.exe und integriert Dir gleich das net Framework 3.5. Voraussetzung dafür ist allerdings, das Du nen Windows 10 Installstick angesteckt hast. Die jeweiligen Pfade mußt Du an Deine Gegebenheiten anpassen. Dieses Script bitte als Admin ausführen.
[code]dism.exe /Mount-Image /ImageFile:D:\image\install.wim /index:1 /MountDir:D:\work\1
dism.exe /Mount-Image /ImageFile:D:\image\install.wim /index:2 /MountDir:D:\work\2
dism.exe /Mount-Image /ImageFile:D:\image\install.wim /index:3 /MountDir:D:\work\3
dism.exe /Mount-Image /ImageFile:D:\image\install.wim /index:4 /MountDir:D:\work\4
reg load "HKLM\TK_SOFTWARE" "D:\work\1\Windows\System32\config\SOFTWARE"
reg load "HKLM\temp_default_profile" "D:\work\1\Users\Default\ntuser.dat"
reg load "HKLM\TK_SYSTEM" "D:\work\1\Windows\System32\config\SYSTEM"
reg add "HKLM\TK_SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d "1" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v PreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SilentInstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v OemPreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg delete "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f
reg unload "HKLM\TK_SOFTWARE"
reg unload "HKLM\temp_default_profile"
reg unload "HKLM\TK_SYSTEM"
reg load "HKLM\TK_SOFTWARE" "D:\work\2\Windows\System32\config\SOFTWARE"
reg load "HKLM\temp_default_profile" "D:\work\2\Users\Default\ntuser.dat"
reg load "HKLM\TK_SYSTEM" "D:\work\2\Windows\System32\config\SYSTEM"
reg add "HKLM\TK_SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d "1" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v PreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SilentInstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v OemPreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg delete "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f
reg unload "HKLM\TK_SOFTWARE"
reg unload "HKLM\temp_default_profile"
reg unload "HKLM\TK_SYSTEM"
reg load "HKLM\TK_SOFTWARE" "D:\work\3\Windows\System32\config\SOFTWARE"
reg load "HKLM\temp_default_profile" "D:\work\3\Users\Default\ntuser.dat"
reg load "HKLM\TK_SYSTEM" "D:\work\3\Windows\System32\config\SYSTEM"
reg add "HKLM\TK_SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d "1" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v PreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SilentInstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v OemPreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg delete "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f
reg unload "HKLM\TK_SOFTWARE"
reg unload "HKLM\temp_default_profile"
reg unload "HKLM\TK_SYSTEM"
reg load "HKLM\TK_SOFTWARE" "D:\work\4\Windows\System32\config\SOFTWARE"
reg load "HKLM\temp_default_profile" "D:\work\4\Users\Default\ntuser.dat"
reg load "HKLM\TK_SYSTEM" "D:\work\4\Windows\System32\config\SYSTEM"
reg add "HKLM\TK_SOFTWARE\Policies\Microsoft\Windows\CloudContent" /v "DisableWindowsConsumerFeatures" /t REG_DWORD /d "1" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v PreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v SilentInstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg add "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\ContentDeliveryManager" /v OemPreinstalledAppsEnabled /d 0 /t "REG_DWORD" /f
reg delete "HKLM\temp_default_profile\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f
reg unload "HKLM\TK_SOFTWARE"
reg unload "HKLM\temp_default_profile"
reg unload "HKLM\TK_SYSTEM"
takeown /f D:\work\1\Windows\System32\OneDriveSetup.exe /A
icacls D:\work\1\Windows\System32\OneDriveSetup.exe /grant Administratoren:F /T /C
del /f /q /s "D:\work\1\Windows\System32\OneDriveSetup.exe"
takeown /f D:\work\2\Windows\System32\OneDriveSetup.exe /A
icacls D:\work\2\Windows\System32\OneDriveSetup.exe /grant Administratoren:F /T /C
del /f /q /s "D:\work\2\Windows\System32\OneDriveSetup.exe"
takeown /f D:\work\3\Windows\System32\OneDriveSetup.exe /A
icacls D:\work\3\Windows\System32\OneDriveSetup.exe /grant Administratoren:F /T /C
del /f /q /s "D:\work\3\Windows\System32\OneDriveSetup.exe"
takeown /f D:\work\4\Windows\System32\OneDriveSetup.exe /A
icacls D:\work\4\Windows\System32\OneDriveSetup.exe /grant Administratoren:F /T /C
del /f /q /s "D:\work\4\Windows\System32\OneDriveSetup.exe"
dism.exe /Image:d:\work\1 /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:E:\sources\sxs
dism.exe /Image:d:\work\2 /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:E:\sources\sxs
dism.exe /Image:d:\work\3 /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:E:\sources\sxs
dism.exe /Image:d:\work\3 /Enable-Feature /FeatureName:NetFx3 /All /LimitAccess /Source:E:\sources\sxs
dism.exe /Unmount-Image /MountDir:D:\work\1 /commit
dism.exe /Unmount-Image /MountDir:D:\work\2 /commit
dism.exe /Unmount-Image /MountDir:D:\work\3 /commit
dism.exe /Unmount-Image /MountDir:D:\work\4 /commit
Dism.exe /Export-Image /SourceImageFile:d:\image\install.wim /All /DestinationImageFile:d:\image\install2.wim /CheckIntegrity /Compress:maximum[/code]