Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


DMD61

How to Delete Apps via setup complete in ISO?

Recommended Posts

Good morning
 

I want to create an ISO of W10 removing apps that are unnecessary.
For example if I want to delete Get Office just run a powershell command like this:

powershell "Get-AppxPackage -allusers *officehub* | Remove-AppxPackage" > NUL 2>&1

 

This command then I insert it in a batch file

@echo off

powershell "Get-AppxPackage -allusers *officehub* | Remove-AppxPackage" > NUL 2>&1

exit

 

This command then I insert it into a batch file (Delete_GetOffice.bat)

This file is placed in the "Software" folder in the root of the ISO of Windows 10

 

Then I created the file Setupcomplete.cmd

 

@echo off

for %%w IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%w:\sources\install.wim SET CDROM=%%w:

REG ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx
SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceEx

REG ADD %KEY% /v Flags /t REG_DWORD /d "20" /f

REG ADD %KEY% /V Title /D "Post Installation..." /f  >NUL

 

REG ADD %KEY%\01 /VE /D "Delete_GetOffice" /f  >NUL
REG ADD %KEY%\01 /V 1 /D "%CDROM%\Software\Delete_GetOffice.bat" /f  >NUL

 

exit

 

and inserted in ISO of Windows 10

 

qybqzd.jpg

 

 

During the nstallation RunOnce runs normally and Powershell command brings up a notice of elimination the App.
But when I open the start menu appears GetOffice yet.
To be sure that the command is correct, you copy the batch file on the desktop and launch the app GetOffice is eliminated normally.
I do not understand why so run Once the app is not deleted, mistake in the procedure?

 

Thank you

Edited by DMD61

Share this post


Link to post
Share on other sites

if i am right the $OEM$ folder should be in image Root folder not in sources folder 

 

a small suggestion if you are running batch script just insert that script in main  .cmd file itself dont create multiple batch files unless you need to run more batch process with system restarts

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...