tn's Guide to removing One Drive and other packages via DISM

Discussion in 'Scripting' started by tnx, Aug 29, 2015.

  1. tnx

    tnx MDL Expert

    Sep 2, 2008
    #1 tnx, Aug 29, 2015
    Last edited: Aug 29, 2015
    I have been asked by a couple of guys via PM on how I am removing packages, like “One Drive” without using the install_wim_tweaker.exe.
    So I have decided to do a little guide on how I do it. Defiantly not the definitive guide but just my little way.
    I like to do things manually and I like to see what is happening, as much as possible anyway.

    I only do this to an off-line image using DISM to do the majority of the work.

    There is one tool I use to aid the taking ownership of the REG keys.
    Downloaded from

    Just go to the download page

    Make sure to select the correct version
    Place the downloaded .exe file into each and every “Remove – Package” folder

    This is my DISM Folder Structure

    C:\DISM\Remove – One Drive

    Place your chosen install.wim file into “C:\DISM\install.wim”

    Save this as a .cmd file, place in the DISM root folder and right click,run as admin

    Inside the “Remove One Drive” folder I have made a series of 6 files. All numbered an in order so the package\s can be removed

    #1 - Load REG Hive

    Save as a .cmd file. Right click and run as admin

    #2 - Take Controll Of One Drive Package REG Key

    Save as a .cmd file. Right click and run as admin

    #3 - One Drive Visible

    Save as a .reg file. Double click to add the registry keys

    #4 - Delete One Drive Owner Key

    Save as a .cmd file. Right click and run as admin

    #5 - Unload REG Hive

    Save as a .cmd file. Right click and run as admin

    #6 - Remove One Drive - Cloud Package

    Save as a .cmd file .Right click and run as admin

    Finally unmount the install.wim file

    Save as a .cmd file. Place in the DISM root folder. Right click and run as admin

    This is the first time I have wrote a guide. Hope folk like it and find it useful.

    I have tested these steps out deleting Cortana and Defender and done test installs and notice no side effects at all.

    These steps could and can be changed to remove any package of your choosing.

    Hope you like it..
  2. AJ79

    AJ79 MDL Novice

    Jul 31, 2015
    Great post 100% working! :biggrin: