Script Create Win11 Version no ADS, Bypass Requirement, Remove Useless APPS, Any Language / Edition

Discussion in 'Windows 11' started by pm67310, Jul 3, 2022.

Tags:
  1. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,325
    2,506
    120
    After search on google you error this indicate broken user profils

    Tested script on windows 10 22h2 clean in spanish mounted windows 11 23h2 iso from c:\win11base and works script to
    C:\Win11LiteCreatorV3

    No erro , you iso from windows 11 are 23h2 or 24h2 ?

    And source ? Microsoft , massgrave ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. TesterMachineOS

    TesterMachineOS MDL Addicted

    Apr 20, 2021
    564
    264
    30
    The iso I have downloaded from uupdump.net is Windows 11 23H2 build

    Corrupted profiles? Is it a problem with the iso?

    After using NSudo to start the script some of these errors did not appear..

    I got only some errors of "ERROR: Incorrect parameter"
     
  3. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,325
    2,506
    120
    Use iso from massgrave
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. TesterMachineOS

    TesterMachineOS MDL Addicted

    Apr 20, 2021
    564
    264
    30
    I don't understand, what is the problem with having an iso downloaded from uupdump.net?

    Why should I use the massgrave isos?

    Do the uupdump.net isos have some corruption problem or something?
     
  5. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,325
    2,506
    120
    Better use original iso ( uup dump are no exempt of bugs )
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. Dark Dinosaur

    Dark Dinosaur X Æ A-12

    Feb 2, 2011
    4,150
    5,947
    150
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,325
    2,506
    120
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,325
    2,506
    120
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,647
    103,299
    450
    Where and in what context?
     
  10. Dark Dinosaur

    Dark Dinosaur X Æ A-12

    Feb 2, 2011
    4,150
    5,947
    150
    Q. Where and in what context
    A. `if this is a reliable source.`

    upload_2024-11-6_22-43-48.png

    upload_2024-11-6_22-40-40.png
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. Enthousiast

    Enthousiast MDL Tester

    Oct 30, 2009
    49,647
    103,299
    450
    Old versions, because WA removed them from the host.
     
  12. fabricio simoes

    fabricio simoes MDL Member

    Dec 17, 2020
    139
    27
    10
    I'm facing the following error when unmounting when I create an iso, and some parameter errors when using this script, any help?

    Code:
    **********************
    Início da transcrição do Windows PowerShell
    Hora de início: 20241106183544
    Nome de Usuário: DESKTOP-SRETMOB\fabricio
    Executar como Usuário: DESKTOP-SRETMOB\fabricio
    Nome da Configuração:
    Computador: DESKTOP-SRETMOB (Microsoft Windows NT 10.0.19045.0)
    Aplicativo Host: PowerShell.exe -Command if((Get-ExecutionPolicy ) -ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & 'E:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1'
    ID do Processo: 3176
    PSVersion: 5.1.19041.5072
    PSEdition: Desktop
    PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.19041.5072
    BuildVersion: 10.0.19041.5072
    CLRVersion: 4.0.30319.42000
    WSManStackVersion: 3.0
    PSRemotingProtocolVersion: 2.3
    SerializationVersion: 1.1.0.1
    **********************
    Transcrição iniciada, o arquivo de saída é E:\Win11LiteCreatorV3\Win11LiteV3.log
    Welcome to the Win11 Lite image creator Release: 30-10-24
    Copying Windows image...
    Copy complete!
    Getting image information:
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Details for image : C:\Win11Lite\sources\install.wim
    
    Index : 1
    Name : Windows 11 Home
    Description : Windows 11 Home
    Size : 18.582.081.503 bytes
    
    Index : 2
    Name : Windows 11 Home Single Language
    Description : Windows 11 Home Single Language
    Size : 18.579.381.548 bytes
    
    Index : 3
    Name : Windows 11 Education
    Description : Windows 11 Education
    Size : 19.093.319.693 bytes
    
    Index : 4
    Name : Windows 11 Pro
    Description : Windows 11 Pro
    Size : 19.095.649.574 bytes
    
    Index : 5
    Name : Windows 11 Pro Education
    Description : Windows 11 Pro Education
    Size : 19.093.370.331 bytes
    
    Index : 6
    Name : Windows 11 Pro for Workstations
    Description : Windows 11 Pro for Workstations
    Size : 19.093.420.969 bytes
    
    The operation completed successfully.
    Mounting Windows image. This may take a while.
    
    ÊXITO: o arquivo (ou o diretório): "C:\Win11Lite\sources\install.wim" agora é de propriedade de "DESKTOP-SRETMOB\fabrici
    o".
    arquivo processado: C:\Win11Lite\sources\install.wim
    Processados com sucesso 1 arquivos; falha no processamento de 0 arquivos
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Mounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    Default system UI language code: pt-BR
    Architecture: amd64
    Mounting complete! Performing removal of applications...
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Image Version: 10.0.26100.1742
    
    The operation completed successfully.
    Loading registry...
    if you have little errors you can ignore safety
    Bypassing system requirements(on the system image):
    Disabling DIAGTRACK aka Diagnostic Tracking Service and PCA Service >used for ask if software installed correctly
    Disabling Bitlocker Forced Encryption and Autoreboot if bluescreen
    Enable Legacy Driver install Change value 0 to 1 to disable
    Disabling Os Update During OOBE
    Script to restore update after OOBE
    Disabling Sponsored Apps:
    Disable Send FEEDBACK
    Disable Reserved Storage
    Disable DevHome and News Outlook autoinstall
    Enabling CUSTOM PRIVACY and Tweaks
    Enabling windows 11 edu theme
    Enabling Delay of 365 days for Features update aka 23h2 to 24h2 , works for Education or enterprise only
    Enabling Delay of 7 days after Microsoft release update any sku aka edition, Windows 11 pro minimum required
    Enabling Local Accounts on OOBE:
    Disabling Reserved Storage:
    Disabling Chat icon:
    Disabling Telemetry:
    True
    Owner changed to Administrators.
    Permissions modified for Administrators group.
    Registry key permissions successfully updated.
    Deleting Application Compatibility Appraiser
    Deleting Customer Experience Improvement Program
    Deleting Program Data Updater
    Deleting autochk proxy
    Deleting QueueReporting
    Tweaking complete!
    Unmounting Registry...
    A operação foi concluída com êxito.
    Cleaning up image...
    Cleanup complete.
    
    Unmounting image...
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Saving image
    [==========================100.0%==========================]
    Unmounting image
    [==========================100.0%==========================]
    
    Error: 0xc1420117
    
    The directory could not be completely unmounted.  This is usually due to applications that still have files opened withi
    n the mount directory.  Close these files and unmount again to complete the unmount process.
    
    The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
    Exporting image...
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    Exporting image
    [==========================100.0%==========================]
    The operation completed successfully.
    Windows image completed. Continuing with boot.wim.
    Mounting boot image:
    arquivo processado: C:\Win11Lite\sources\boot.wim
    Processados com sucesso 1 arquivos; falha no processamento de 0 arquivos
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    
    Error: 0xc1420114
    
    The user attempted to mount to a directory that is not empty.  This is not supported.
    
    The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
    Loading registry...
    ERRO: O sistema não pôde localizar a chave do Registro ou valor especificado.
    ERRO: O sistema não pôde localizar a chave do Registro ou valor especificado.
    ERRO: O sistema não pôde localizar a chave do Registro ou valor especificado.
    ERRO: O sistema não pôde localizar a chave do Registro ou valor especificado.
    ERRO: O sistema não pôde localizar a chave do Registro ou valor especificado.
    Bypassing system requirements(on the setup image):
    Tweaking complete!
    Unmounting Registry...
    ERRO: Parâmetro incorreto.
    Unmounting image...
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.3636
    
    
    Error: 0xc142011d
    
    The specified mounted image cannot be committed back into the WIM.  This occurs when an image has been through a partial
     unmount or when an image is still being mounted.  If this image was unmounted with commit earlier, then the commit prob
    ably succeeded.  Please validate that this is the case and then unmount without commit.
    
    The DISM log file can be found at C:\Windows\Logs\DISM\dism.log
    The Win11Lite image is now completed. Proceeding with the making of the ISO...
    Creating ISO image...
    Will be using oscdimg.exe from system ADK.
    
    OSCDIMG 2.56 CD-ROM and DVD-ROM Premastering Utility
    Copyright (C) Microsoft, 1993-2012. All rights reserved.
    Licensed only for producing Microsoft authorized content.
    
    
    Scanning source tree (1000 files in 104 directories)
    Scanning source tree complete (1110 files in 116 directories)
    
    Computing directory information complete
    
    Image file is 4380590080 bytes (before optimization)
    
    Writing 1110 files in 116 directories to E:\Win11LiteCreatorV3\Win11LiteV3.iso
    
    100% complete
    
    Storage optimization saved 66 files, 15788032 bytes (1% of image)
    
    After optimization, image file is 4367427584 bytes
    Space saved because of embedding, sparseness or optimization = 15788032
    
    Done.
    Creation completed! Press any key to exit the script...
    
    Performing Cleanup...
    **********************
    Fim da transcrição do Windows PowerShell
    Hora de término: 20241106192213
    **********************
    
     
  13. Carlos Detweiller

    Carlos Detweiller Emperor of Ice-Cream

    Dec 21, 2012
    6,755
    7,688
    210
    "atm" - Internet slang, usually means "at time meaning" or "at the moment".
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,325
    2,506
    120
    #76 pm67310, Nov 7, 2024
    Last edited: Nov 7, 2024
    (OP)
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  15. TesterMachineOS

    TesterMachineOS MDL Addicted

    Apr 20, 2021
    564
    264
    30
    I still get errors:

    The downloaded iso is from massgrave

    Code:
    **********************
    PowerShell transcript start
    Start time: 20241107130622
    Username: DESKTOP-H79GMMF\TESTER
    RunAs User: DESKTOP-H79GMMF\TESTER
    Configuration Name:
    Machine: DESKTOP-H79GMMF (Microsoft Windows NT 10.0.19044.0)
    Host Application: C:\Program Files\PowerShell\7\pwsh.dll
    Process ID: 5516
    PSVersion: 7.4.6
    PSEdition: Core
    GitCommitId: 7.4.6
    OS: Microsoft Windows 10.0.19044
    Platform: Win32NT
    PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1, 6.0, 7.0
    PSRemotingProtocolVersion: 2.3
    SerializationVersion: 1.1.0.1
    WSManStackVersion: 3.0
    **********************
    Transcript started, output file is C:\Win11LiteCreatorV3\Win11LiteV3.log
    Welcome to the Win11 Lite image creator Release: 30-10-24
    Copying Windows image...
    Copy complete!
    Getting image information:
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Details for image : C:\Win11Lite\sources\install.wim
    
    Index : 1
    Name : Windows 11 Home
    Description : Windows 11 Home
    Size : 19.466.199.244 bytes
    
    Index : 2
    Name : Windows 11 Home N
    Description : Windows 11 Home N
    Size : 18.781.646.719 bytes
    
    Index : 3
    Name : Windows 11 Home Single Language
    Description : Windows 11 Home Single Language
    Size : 19.445.940.337 bytes
    
    Index : 4
    Name : Windows 11 Education
    Description : Windows 11 Education
    Size : 19.856.635.568 bytes
    
    Index : 5
    Name : Windows 11 Education N
    Description : Windows 11 Education N
    Size : 19.175.536.249 bytes
    
    Index : 6
    Name : Windows 11 Pro
    Description : Windows 11 Pro
    Size : 19.859.313.076 bytes
    
    Index : 7
    Name : Windows 11 Pro N
    Description : Windows 11 Pro N
    Size : 19.177.826.124 bytes
    
    Index : 8
    Name : Windows 11 Pro Education
    Description : Windows 11 Pro Education
    Size : 19.856.585.778 bytes
    
    Index : 9
    Name : Windows 11 Pro Education N
    Description : Windows 11 Pro Education N
    Size : 19.175.485.559 bytes
    
    Index : 10
    Name : Windows 11 Pro for Workstations
    Description : Windows 11 Pro for Workstations
    Size : 19.856.610.673 bytes
    
    Index : 11
    Name : Windows 11 Pro N for Workstations
    Description : Windows 11 Pro N for Workstations
    Size : 19.175.510.904 bytes
    
    The operation completed successfully.
    Mounting Windows image. This may take a while.
    
    CORRECTO: el archivo (o carpeta): "C:\Win11Lite\sources\install.wim" ahora es propiedad del usuario "DESKTOP-H79GMMF\Yog
    enis".
    archivo procesado: C:\Win11Lite\sources\install.wim
    Se procesaron correctamente 1 archivos; error al procesar 0 archivos
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Mounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    Default system UI language code: es-ES
    Architecture: amd64
    Mounting complete! Performing removal of applications...
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Image Version: 10.0.22631.4317
    
    The operation completed successfully.
    Loading registry...
    if you have little errors you can ignore safety
    Bypassing system requirements(on the system image):
    Disabling DIAGTRACK aka Diagnostic Tracking Service and PCA Service >used for ask if software installed correctly
    Disabling Bitlocker Forced Encryption and Autoreboot if bluescreen
    Enable Legacy Driver install Change value 0 to 1 to disable
    Disabling Os Update During OOBE
    Script to restore update after OOBE
    Disabling Sponsored Apps:
    Disable Send FEEDBACK
    Disable Reserved Storage
    Disable DevHome and News Outlook autoinstall
    Enabling CUSTOM PRIVACY and Tweaks
    Enabling windows 11 edu theme
    Enabling Delay of 365 days for Features update aka 23h2 to 24h2 , works for Education or enterprise only
    Enabling Delay of 7 days after Microsoft release update any sku aka edition, Windows 11 pro minimum required
    Enabling Local Accounts on OOBE:
    Disabling Reserved Storage:
    Disabling Chat icon:
    Disabling Telemetry:
    False
    MethodInvocationException: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:377
    Line |
     377 |  $regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTW …
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | Exception calling "OpenSubKey" with "3" argument(s): "Requested registry access is not allowed."
    MethodInvocationException: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:377
    Line |
     377 |  $regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTW …
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | Exception calling "OpenSubKey" with "3" argument(s): "Requested registry access is not allowed."
    
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:378
    Line |
     378 |  $regACL = $regKey.GetAccessControl()
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:378
    Line |
     378 |  $regACL = $regKey.GetAccessControl()
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:379
    Line |
     379 |  $regACL.SetOwner($adminGroup)
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:379
    Line |
     379 |  $regACL.SetOwner($adminGroup)
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:380
    Line |
     380 |  $regKey.SetAccessControl($regACL)
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:380
    Line |
     380 |  $regKey.SetAccessControl($regACL)
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:381
    Line |
     381 |  $regKey.Close()
         |  ~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:381
    Line |
     381 |  $regKey.Close()
         |  ~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    
    Owner changed to Administrators.
    MethodInvocationException: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:383
    Line |
     383 |  $regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTW …
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | Exception calling "OpenSubKey" with "3" argument(s): "Requested registry access is not allowed."
    MethodInvocationException: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:383
    Line |
     383 |  $regKey = [Microsoft.Win32.Registry]::LocalMachine.OpenSubKey("zSOFTW …
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | Exception calling "OpenSubKey" with "3" argument(s): "Requested registry access is not allowed."
    
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:384
    Line |
     384 |  $regACL = $regKey.GetAccessControl()
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:384
    Line |
     384 |  $regACL = $regKey.GetAccessControl()
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:386
    Line |
     386 |  $regACL.SetAccessRule($regRule)
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:386
    Line |
     386 |  $regACL.SetAccessRule($regRule)
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:387
    Line |
     387 |  $regKey.SetAccessControl($regACL)
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:387
    Line |
     387 |  $regKey.SetAccessControl($regACL)
         |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    
    Permissions modified for Administrators group.
    Registry key permissions successfully updated.
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:390
    Line |
     390 |  $regKey.Close()
         |  ~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:390
    Line |
     390 |  $regKey.Close()
         |  ~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    
    Deleting Application Compatibility Appraiser
    Deleting Customer Experience Improvement Program
    Deleting Program Data Updater
    Deleting autochk proxy
    Deleting QueueReporting
    Tweaking complete!
    Unmounting Registry...
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:407
    Line |
     407 |  $regKey.Close()
         |  ~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    InvalidOperation: C:\Win11LiteCreatorV3\Win11LiteCreatorV3.ps1:407
    Line |
     407 |  $regKey.Close()
         |  ~~~~~~~~~~~~~~~
         | You cannot call a method on a null-valued expression.
    
    La operación se completó correctamente.
    Cleaning up image...
    Cleanup complete.
    
    Unmounting image...
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Saving image
    [==========================100.0%==========================]
    Unmounting image
    [==========================100.0%==========================]
    The operation completed successfully.
    Exporting image...
    
    Deployment Image Servicing and Management tool
    Version: 10.0.19041.844
    
    Exporting image
    [===========                19.0%                          ]
    
    I don't understand what's happening, I'm following everything correctly.

    The iso is original, the script location is in C:\ and I still get errors regarding access denied, having the system with UAC disabled, in Windows 10 Pro 21H2(19044.1165)
     
  16. TesterMachineOS

    TesterMachineOS MDL Addicted

    Apr 20, 2021
    564
    264
    30
    @pm67310
    I'm sorry for bothering me with these errors, could you check your script?

    I see that something must be wrong, I modified the script in just one thing, I replaced the value ">null" to just ">nul" some errors were reduced but it also prevents a file called "null" from being output where part of the code is displayed... I have no idea why, maybe because ">null" is placed and PowerShell detects it to write to a file instead of deleting some messages...

    but I still get errors of access denied or errors in parameters...

    even changed the position of one of the lines to first is the following:
    Code:
    <#
    .SYNOPSIS
        Clean Windows 11 ISO (needs admin rights).
    .DESCRIPTION
        This PowerShell script CLEAN Windows 11 by removing unused apps in business environenement and apply lights privacy setting.
    .NOTES
        Author: Pm67310
    #>
    
    # Enable debugging
    #Set-PSDebug -Trace 1
    
    param ($ScratchDisk)
    
    if ($Null -eq $ScratchDisk) {
        $ScratchDisk = $env:SystemDrive
    }
    
    # Check if PowerShell execution is restricted
    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
        }
    }
    I could see that it marked an error in param, and reading in the Microsoft documents regarding the PowerShell commands param must be first before the code, which solved an error of "line 47 param is not recognized as a cmdlet"
     
  17. pm67310

    pm67310 MDL Guru

    Sep 6, 2011
    3,325
    2,506
    120
    #79 pm67310, Nov 7, 2024
    Last edited: Nov 7, 2024
    (OP)
    Formated computer installed spanish 23h2

    Created win11lite ( with windows 11 24h2 26100.2033 , used link from first post )

    with script no error work fines for me

    You used N sku or standard ?

    And pro edition or others ?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  18. TesterMachineOS

    TesterMachineOS MDL Addicted

    Apr 20, 2021
    564
    264
    30
    I only use the Pro sku

    I have tried other powershell scripts (like Pure11) and I don't get this kind of errors.

    Used ISO Windows 11 Consumer 23H2 from massgrave