How to delete contents of a mounted wim file

User discussion and information resource forum for TeraByte Drive Image products, including TBNetManage.
Post Reply
Mr.X
Posts: 106
Joined: Mon Oct 20, 2014 12:31 am

How to delete contents of a mounted wim file

Post by Mr.X »

I want to delete a couple of folders containing programs I added into the installed WinRE.
I want to use commands lines in the BuildScript.cmd
OldNavyGuy
Posts: 171
Joined: Mon Apr 17, 2023 4:08 am

Re: How to delete contents of a mounted wim file

Post by OldNavyGuy »

rmdir [folder] /s /q
Mr.X
Posts: 106
Joined: Mon Oct 20, 2014 12:31 am

Re: How to delete contents of a mounted wim file

Post by Mr.X »

I tried that command before but something strange happens.

Example:

Code: Select all

rmdir "%TBWinPE_MountPath%\Program Files\Program for partitioning" /S /Q
Then I re-create the installed WinRE,
After that I boot the installed WinRE and go to X:\Program Files\ and indeed the folder is gone.

Then I come back to my BuildScript.cmd file and delete the command line.
After that I re-create the installed WinRE build.
Then I boot the build, go to X:\Program Files\ and surprisingly the folder reappears with all its contents.
OldNavyGuy
Posts: 171
Joined: Mon Apr 17, 2023 4:08 am

Re: How to delete contents of a mounted wim file

Post by OldNavyGuy »

Sounds like you're looking at a restored version of the .wim file, after the cmd runs.
Mr.X
Posts: 106
Joined: Mon Oct 20, 2014 12:31 am

Re: How to delete contents of a mounted wim file

Post by Mr.X »

Alright, I started anew with a fresh clean winre.wim following this guide:
Repairing the Windows Recovery Environment (WinRE)

I think it's better this approach.
Post Reply