@MSMG Oh..ok. It should work out of the box I fix it this way and it works fine except for "index2" Program Files (x86) that one keeps giving NT Security: xxxxx Domain d:xxxx Adapt it for new x86/64 builds. Not sure where the folder permission bug is coming from as it's a fresh OS install, nothing else added...Only the required stuff for PowerShell. Have to try again on vm then... Code: @echo off setlocal enabledelayedexpansion pushd "%~dp0bin" if exist "%windir%\SysWOW64" set "arch=x64" if not exist "%windir%\SysWOW64" set "arch=x86" set wimlib=%~dp0bin\%arch%\wimlib-imagex.exe set dism=%~dp0bin\%arch%\dism10\dism set nsudo=%~dp0bin\%arch%\nsudo set icacls=%~dp0bin\%arch%\icacls.exe set cecho=%~dp0bin\%arch%\cecho.exe set psini=%~dp0bin\%arch%\PowerShell.ini %cecho% {07}Create {0a}PowerShell Build 7.x.x X86 {07}:: {0a}X64 TPK Package {#} echo. echo. echo. echo. %cecho% {07}[1] {0a}:: {1f}Capture PowerShell Build 7.x.x X86 {#} echo. echo. rem wimlib -- x86 config.ini %nsudo% -U:T -P:E cmd /c %wimlib% capture c:\ %~dp0bin\x86\PowerShell7_WIN7_x86.wim "Windows PowerShell 7.1.2 (x86)" "Windows PowerShell 7.1.2 (x86)" --config=%psini% rem wimlib -- x86 source.txt command 1 rem %nsudo% -U:T -P:E cmd /c %wimlib% capture %~dp0bin\x86\PowerShell_X86-source.txt %~dp0bin\x86\powershell7_WIN7_x86.wim --source-list rem wimlib -- source.txt command 2 rem %nsudo% -U:T -P:E cmd /c %wimlib% capture %~dp0bin\x86\PowerShell_X86-source.txt %~dp0bin\x86\powershell7_WIN7_x86.wim --strict-acls --source-list :nxt %cecho% {07}[2] {0a}:: {1f}Capture PowerShell Build 7.x.x X64 {#} echo. echo. rem wimlib -- x64 config.ini %nsudo% -U:T -P:E cmd /c %wimlib% capture M:\ %~dp0bin\x64\PowerShell7_WIN7_x64.wim "Windows PowerShell 7.1.2 (x64)" "Windows PowerShell 7.1.2 (x64)" --config=%~dp0bin\x64\PowerShell.ini rem wimlib -- x64 source.txt command 1 rem %nsudo% -U:T -P:E cmd /c %wimlib% capture %~dp0bin\x64\PowerShell_X64-source.txt %~dp0bin\x64\powershell7_WIN7_x64.wim --source-list rem wimlib -- x64 source.txt command 2 rem %nsudo% -U:T -P:E cmd /c %wimlib% capture %~dp0bin\x64\PowerShell_X64-source.txt %~dp0bin\x64\powershell7_WIN7_x64.wim --strict-acls --source-list echo. pause :nxt2 echo. %cecho% {07}[3] {0a}:: {07}Apply the {0a}PowerShell 7.x.x {07}WIN7 {0e}x86 {07}::: {0e}x64 {07}WIM Images {#} echo. echo. md %~dp0bin\x86mount >nul md %~dp0bin\x64mount >nul timeout /t 2 >nul %dism% /Apply-Image /ImageFile:%~dp0bin\x86\PowerShell7_WIN7_x86.wim /Index:1 /ApplyDir:%~dp0bin\x86mount /CheckIntegrity /Verify %dism% /Apply-Image /ImageFile:%~dp0bin\x64\PowerShell7_WIN7_x64.wim /Index:1 /ApplyDir:%~dp0bin\x64mount /CheckIntegrity /Verify echo. pause :nxt3 echo. %cecho% {07}Note: {0a}Modify the mountfolders incase required... {#} echo. echo. pause echo. %cecho% {07}[4] {0a}:: {07}Fix and set the folder permissions and attributes correctly...{#} echo. echo. rem md "%~dp0bin\x86mount\ProgramData\Microsoft\Netframework\BreadcrumbStore" rem md "%~dp0bin\x64mount\ProgramData\Microsoft\Netframework\BreadcrumbStore" rem for /f "delims=" %%L in (%~dp0bin\x86\BreadcrumbStore_x86.txt) do copy "%%L" "%~dp0bin\x86mount\ProgramData\Microsoft\Netframework\BreadcrumbStore" rem for /f "delims=" %%L in (%~dp0bin\x86\BreadcrumbStore_x86.txt) do copy "%%L" "%~dp0bin\x64mount\ProgramData\Microsoft\Netframework\BreadcrumbStore" rem xcopy "%~dp0bin\x86mount2\Program Files (x86)\PowerShell" "%~dp0bin\x64mount\Program Files (x86)\PowerShell\" /s /y >nul rem folder permissions/owner.... %icacls% "%~dp0bin\x86mount\Program Files" /setowner "NT SERVICE\TrustedInstaller" %nsudo% -U:S -P:E cmd /c %icacls% "%~dp0bin\x64mount\Program Files" /setowner "NT SERVICE\TrustedInstaller" %nsudo% -U:S -P:E cmd /c %icacls% "%~dp0bin\x64mount\Program Files (x86)" /setowner "NT SERVICE\TrustedInstaller" %icacls% "%~dp0bin\x86mount\Program Files\PowerShell" /setowner SYSTEM /T %nsudo% -U:S -P:E cmd /c %icacls% "%~dp0bin\x64mount\Program Files\PowerShell" /setowner SYSTEM /T %nsudo% -U:S -P:E cmd /c %icacls% "%~dp0bin\x64mount\Program Files (x86)\PowerShell" /setowner SYSTEM /T rem %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft" /setowner Administrators rem %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft" /setowner Administrators rem %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Netframework" /restore "%~dp0bin\installers\BreadcrumbStore_acl" rem %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\NetframeWork" /restore "%~dp0bin\installers\BreadcrumbStore_acl" %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Netframework" /setowner SYSTEM /T %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\Netframework" /setowner SYSTEM /T rem %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Netframework\BreadcrumbStore" /setowner SYSTEM /T rem %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\Netframework\BreadcrumbStore" /setowner SYSTEM /T rem %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Windows" /setowner Administrators rem %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\Windows" /setowner Administrators %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Windows\Start Menu" /setowner Administrators %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\Windows\Start Menu" /setowner Administrators %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Windows\Start Menu\Programs" /setowner Administrators %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\Windows\Start Menu\Programs" /setowner Administrators %icacls% "%~dp0bin\x86mount\ProgramData\Microsoft\Windows\Start Menu\Programs\PowerShell" /setowner SYSTEM /T %icacls% "%~dp0bin\x64mount\ProgramData\Microsoft\Windows\Start Menu\Programs\PowerShell" /setowner SYSTEM /T rem x86 installer %icacls% "%~dp0bin\x86mount\Windows\Installer\{887BBD1D-0B7E-44E5-B6A6-F06C0CC0E44D}" /setowner SYSTEM %icacls% "%~dp0bin\x86mount\Windows\Installer\SourceHash{887BBD1D-0B7E-44E5-B6A6-F06C0CC0E44D}" /setowner SYSTEM %icacls% "%~dp0bin\x64mount\Windows\Installer\{887BBD1D-0B7E-44E5-B6A6-F06C0CC0E44D}" /setowner SYSTEM %icacls% "%~dp0bin\x64mount\Windows\Installer\SourceHash{887BBD1D-0B7E-44E5-B6A6-F06C0CC0E44D}" /setowner SYSTEM rem x64 installer %icacls% "%~dp0bin\x64mount\Windows\Installer\{357A3946-1572-4A21-9B60-4C7BD1BB9761}" /setowner SYSTEM %icacls% "%~dp0bin\x64mount\Windows\Installer\SourceHash{357A3946-1572-4A21-9B60-4C7BD1BB9761}" /setowner SYSTEM rem Set folder and files attributes attrib -i "%~dp0bin\x86mount\Program Files" attrib -i "%~dp0bin\x86mount\Program Files\*.*" /s /d attrib -i "%~dp0bin\x64mount\Program Files" attrib -i "%~dp0bin\x64mount\Program Files\*.*" /s /d attrib +r "%~dp0bin\x86mount\Program Files" attrib +r "%~dp0bin\x64mount\Program Files" attrib -i "%~dp0bin\x86mount\ProgramData\*.*" /s /d attrib -i "%~dp0bin\x64mount\ProgramData\*.*" /s /d attrib -i "%~dp0bin\x86mount\Windows\Installer\*.*" /s attrib -i "%~dp0bin\x64mount\Windows\Installer\*.*" /s attrib -i "%~dp0bin\x86mount\Windows" attrib -i "%~dp0bin\x64mount\Windows" attrib -a "%~dp0bin\x86mount\Windows" attrib -a "%~dp0bin\x64mount\Windows" attrib -i "%~dp0bin\x86mount" echo. timeout /t 5 >nul :nxt4 echo. %cecho% {07}[5] {0a}:: {07}Capture the {0d}PowerShell7 {07}WIN7 {0e}x86 {07}::: {0e}x64 {07}mounted Builds to {0a}WIM Images... {#} echo. echo. %dism% /Capture-Image /ImageFile:%~dp0bin\x86\PowerShell7_WIN7_x86_2.wim /CaptureDir:%~dp0bin\x86mount\ /Name:"Windows PowerShell 7.1.2 (x86)" /Description:"Windows PowerShell 7.1.2 (x86)" /Compress:max %dism% /Capture-Image /ImageFile:%~dp0bin\x64\PowerShell7_WIN7_x64_2.wim /CaptureDir:%~dp0bin\x64mount\ /Name:"Windows PowerShell 7.1.2 (x64)" /Description:"Windows PowerShell 7.1.2 (x64)" /Compress:max echo. pause :nxt5 echo. %cecho% {07}[6] {0a}:: {07}Export the {0a}PowerShell7 {07}WIN7 {0e}x86 {07}::: {0e}x64 {07}WIM Images {0e}to {07}ESD Images {0a}:: {0d}LZMS:27 {07}Compression {#} echo. echo. %dism% /Export-Image /SourceImageFile:%~dp0bin\x86\PowerShell7_WIN7_x86_2.wim /SourceIndex:1 /Scratchdir:"%~dp0bin\Scratch" /DestinationImageFile:%~dp0bin\x86\PowerShell7_WIN7_x86.tpk /Compress:Recovery echo. pause %dism% /Export-Image /SourceImageFile:%~dp0bin\x64\PowerShell7_WIN7_x64_2.wim /SourceIndex:1 /Scratchdir:"%~dp0bin\\Scratch" /DestinationImageFile:%~dp0bin\x64\PowerShell7_WIN7_x64.esd /Compress:Recovery echo. pause :nxt6 echo. %cecho% {07}[7] {0a}:: {07}Combine the {0a}PowerShell7 {07}WIN7 {0e}x86 {07}::: {0e}x64 {07}ESD Images {#} echo. echo. %wimlib% export %~dp0bin\x64\PowerShell7_WIN7_x64.esd 1 %~dp0bin\x86\PowerShell7_WIN7_x86.tpk "Windows PowerShell 7.1.2 (x64)" "Windows PowerShell 7.1.2 (x64)" --compress=LZMS --solid echo. pause rem %nsudo% -U:T -P:E cmd /c %wimlib% export %~dp0bin\x64\PowerShell7_WIN7_x64_2.wim 1 %~dp0bin\x86\PowerShell7_WIN7_x86_2.tpk "Windows PowerShell 7.1.2 (x64)" "Windows PowerShell 7.1.2 (x64)" --check --solid rem %wimlib% export "%~dp0bin\x86\PowerShell7_WIN7_x86_2.wim" all "%~dp0bin\x86\PowerShell7_WIN7_3.tpk" --compress=LZMS --solid rem %nsudo% -U:S -P:E cmd /c %dism% /Export-Image /SourceImageFile:%~dp0bin\x64\PowerShell7_WIN7_x64_2.wim /SourceIndex:1 /DestinationImageFile:%~dp0bin\x86\PowerShell7_WIN7_x86_2.tpk /DestinationName:"Windows PowerShell 7.1.2 (x64)" /Compress:max rem Optimize the PowerShell7_WIN7 x86/x64 WIM Image :: Fixes "incorrect reference count" reported by 7zip... rem %wimlib% optimize %~dp0bin\x86\PowerShell7_WIN7_3.TPK rem :timer6 rem for /f %%x in ('tasklist /NH /FI "IMAGENAME eq wimlib-imagex.exe"') DO IF %%x == wimlib-imagex.exe goto busy rem goto nxt6 rem :busy rem timeout /t 3 >nul rem goto timer6 :nxt7 echo. %cecho% {0b}Cleanup temp folders and files... {#} echo. echo. ren %~dp0bin\x86\PowerShell7_WIN7_x86.tpk PowerShell7_WIN7.tpk >nul move /y %~dp0bin\x86\PowerShell7_WIN7.tpk %~dp0bin\tpk\PowerShell >nul del %~dp0bin\x86\PowerShell7_WIN7_x86.wim >nul del %~dp0bin\x64\PowerShell7_WIN7_x64.wim >nul del %~dp0bin\x86\PowerShell7_WIN7_x86_2.wim >nul del %~dp0bin\x64\PowerShell7_WIN7_x64_2.wim >nul del %~dp0bin\x64\PowerShell7_WIN7_x64.esd >nul rd /s /q %~dp0bin\x86mount >nul rd /s /q %~dp0bin\x64mount >nul
Hi MSMG I want to integrate language pack into W10 Ltsb EN-US 1607 non-n, so far i got it working without any cu updates But when i integrate CU updates it's not working anymore, i know about the setup media after updates, but what package do i need for 1607 non-n I have the LP an media-FP packs from you're site installed + the 40mb cab LP file from MS I must be missing something
Think the updated image version when the CU is integrated is not getting verified in the Language Pack Integration code. Will check the script.
OK. Setup works with both LP, but Windows wont install correctly, OS is failing when installing updates Is it possible to use component store cleanup, without resetbase ? if i do not enable resetbase [M] option Cleanup resetbase does not all the time get 100%, this happens only on boot.wim an winre.wim, install.wim always gets 100% strange But at least, it is Sfc error free
@MSMG, I replaced the command from the toolkit v9.8 for the Oscdimg and it appears to be working now. MSMG bud, thank you for making this tool on my request and changing it to my liking. You're the best! Leaving the code here for anyone who might find it useful. Code: @echo off color 1f title Bootable ISO Maker setlocal EnableExtensions EnableDelayedExpansion :: Getting HOST architecture If exist "%WinDir%\SysWOW64" set "Oscdimg=%~dp0oscdimg64.exe" If not exist "%WinDir%\SysWOW64" set "Oscdimg=%~dp0oscdimg.exe" set "DVD=%~dp0DVD" set "BIOSBoot=%DVD%\boot\etfsboot.com" set "UEFIBoot=%DVD%\efi\microsoft\boot\efisys.bin" set "ISO=%~dp0ISO" set ISOLabel= set ISOFileName= cls echo.=============================================================================== echo. Make a Bootable DVD ISO Image echo.=============================================================================== echo. echo.------------------------------------------------------------------------------- echo.####Starting Building a DVD ISO Image########################################## echo.------------------------------------------------------------------------------- echo. :: Getting ISO Label Name set /p ISOLabel=Enter ISO Volume Label : echo. :: Getting ISO Filename set /p ISOFileName=Enter ISO Filename : echo. :: Building a Bootable DVD ISO Image for Booting with BIOS/UEFI Systems echo.------------------------------------------------------------------------------- echo.####Building a DVD ISO Image################################################### echo.------------------------------------------------------------------------------- if "%ISOLabel%" equ "" ( if exist "%UEFIBoot%" "%Oscdimg%" -bootdata:2#p0,e,b"%BIOSBoot%"#pEF,e,b"%UEFIBoot%" -o -h -m -u2 -udfver102 "%DVD%" "%ISO%\%ISOFileName%.iso" if not exist "%UEFIBoot%" "%Oscdimg%" -bootdata:1#p0,e,b"%BIOSBoot%" -o -h -m -u2 -udfver102 "%DVD%" "%ISO%\%ISOFileName%.iso" ) if "%ISOLabel%" neq "" ( if exist "%UEFIBoot%" "%Oscdimg%" -bootdata:2#p0,e,b"%BIOSBoot%"#pEF,e,b"%UEFIBoot%" -o -h -m -u2 -udfver102 -l"%ISOLabel%" "%DVD%" "%ISO%\%ISOFileName%.iso" if not exist "%UEFIBoot%" "%Oscdimg%" -bootdata:1#p0,e,b"%BIOSBoot%" -o -h -m -u2 -udfver102 -l"%ISOLabel%" "%DVD%" "%ISO%\%ISOFileName%.iso" ) echo. echo.------------------------------------------------------------------------------- echo.####Finished Building a DVD ISO Image########################################## echo.------------------------------------------------------------------------------- echo. echo.=============================================================================== echo. pause set ISOSource= set ISOLabel= set ISOFileName= color 00 endlocal EnableExtensions EnableDelayedExpansion exit
Will check with 1607 image and report back. Yes you can use component store cleanup, without resetbase and it's normal for progress bar not showing 100% every time. Only for v2004 and above the cleanup is causing the ghost SFC error.
Do I need to mount the image first? If so, how can I list the packages in the txt file? In general, what should the entire script look like? p.s Do not quite understand!
Is Feature update to Windows 10, version 21H1 (19043.844) amd64 from UUP dump supported? I see it can remove components but when I tried integrating f.i. DirectX9c applied something to the image and returned lines of errors about the register. I accidentally closed it before coping full text. It was something like can't write to the registry, it's in use by another process, something like this. The same with dotnet5. But besides that, it works fine. Enabling WSL kinda works, doesn't install Linux kernel. TFTP works. I don't remember what else but it mostly works. To remove everything but keep Sticky Notes Onenote Microsoft Store everything related to games and Xbox weather clock, stopper, countdown (alarms?) photos app, but not exactly - I need this feature to trim a video Could you advise what's 99% 95% 90% 80% safe to remove?
With the new version of toolkit.cmd on 03/04/2021, when integrating updates from 804 to 844, I also observed errors when writing to the registry. "Invalid section name".
Hello MSMG well I have had a problem that irritates me a lot because I still couldn't solve it see then: on my second disc I have a file called D: \ found.000 in which I can't remove it by any chance (access denied) Do you have any suggestion? thank you in advance
The file named "found.000" is from chkdsk, it puts these folders and files inside the folder when it finds corrupted fragments on the partition, instead of deleting them it puts them here. Windows lists .CHK files as “recovered file fragments”. A single .CHK file can actually contain one or more complete files, fragments of a single file, or fragments of many files. unfortunately you usually won’t be able to recover much data from .CHK files. The reason you are even seeing it is because you have "show hidden files" enabled in windows explorer. They usually aren't visable to the user. Try manually deleting them from the command prompt with administrator privileges. Or you could just leave them, if the are small sized it isn't going to mess with anything. If you keep on seeing new files created here, it could be a sign your hdd is starting to fail. It wouldn't be a bad idea to check it's smart status.
ok I already know almost the whole process to remove this annoying file but I believe that there is a missing command in cmd that I have not yet discovered; and as for the health of my 2nd disc I have already tested it with the appropriate program and it is 100% so I must wait for our master and see what he says anyway thanks for your attention
@Tiger-1 , try to use this script. with adm privileges The script will find it on all drives and ask if you want to remove it.
Thank you for this great tool But I have a question: how can I make (edge) the default browser through the tool in the Windows version (10 ltsc)