Windows 10: Dism /Apply-Image and remove the entire content of the directory

Page 1 of 2 12 LastLast
  1.    26 Dec 2015 #1

    Dism /Apply-Image and remove the entire content of the directory


    Hi

    I installed Windows ADK 10 v1511 on Windows 10 v1511 Enterprise 64 bit.

    I typed the following commands:

    Code:
    Dism /Apply-Image /ImageFile:"<wim_File_Path>\install.wim" /Index:1 /ApplyDir:"<Apply_Directory_Path>" /Verify /CheckIntegrity
    Dism /Capture-Image /ImageFile:"<Windows_Files_Path>\sources\install.wim" /CaptureDir:"<Apply_Directory_Path>" /Name:"<Edition_name>" /Description:"<Description_name>" /Compress:max /Verify /CheckIntegrity
    Now, what is the command that allows to completely remove the entire content of the <Apply_Directory_Path> directory?

    Thanks

    Bye
      My ComputerSystem Spec

  2.    26 Dec 2015 #2

    Do you mean you want to delete everything in the directory but leave the directory itself?

    If so this should do it
    Code:
    pushd "<Apply_Directory_Path>" && (rd /s /q "<Apply_Directory_Path>" 2>nul & popd)
      My ComputerSystem Spec

  3.    26 Dec 2015 #3

    lx07 said: View Post
    Do you mean you want to delete everything in the directory but leave the directory itself?

    If so this should do it
    Code:
    pushd "<Apply_Directory_Path>" && (rd /s /q "<Apply_Directory_Path>" 2>nul & popd)
    I already tried and this command does not work because the files and directories owner is the System or TrustedInstaller user.

    I noticed that the <Apply_Directory_Path> directory has also changed owner and now it has, as owner, TrustedInstaller user. Why?

    Thanks

    Bye
      My ComputerSystem Spec

  4.    26 Dec 2015 #4

    You can try to take ownership with
    Code:
    takeown  /f  "<Apply_Directory_Path>" /r
    icacls       "<Apply_Directory_Path>" /grant "%USERDOMAIN%\%USERNAME%":(F) /t
    and then delete the contents.
      My ComputerSystem Spec


  5. Posts : 1,841
    Windows 3.1 to Windows 10
       26 Dec 2015 #5

    You applied the install.wim to the directory... Thus by applying the install.wim - you installed windows (trusted installer)....
      My ComputerSystem Spec

  6.    27 Dec 2015 #6

    lx07 said: View Post
    You can try to take ownership with
    Code:
    takeown  /f  "<Apply_Directory_Path>" /r
    icacls "<Apply_Directory_Path>" /grant "%USERDOMAIN%\%USERNAME%":(F) /t
    and then delete the contents.
    Unfortunately, in the <Apply_Directory_Path> directory, there are also some read-only subdirectories.

    So, how do I change the icacls command to also remove the read-only attribute to delete also these subdirectories?

    Thanks

    Bye
      My ComputerSystem Spec

  7.    29 Dec 2015 #7

    I await a reply.

    Thanks

    Bye
      My ComputerSystem Spec

  8.   My ComputerSystem Spec

  9.    29 Dec 2015 #9

    If I write:

    Code:
    takeown  /f  "<Apply_Directory_Path>" /r
    icacls "<Apply_Directory_Path>" /grant "%USERDOMAIN%\%USERNAME%":(F,WDAC) /t
    I reach the same my purpose?

    Thanks

    Bye
      My ComputerSystem Spec

  10.    02 Jan 2016 #10

    In conclusion, if I use the following commands

    Code:
    takeown /f "<Apply_Directory_Path>" /R /A /D Y
    icacls "<Apply_Directory_Path>" /grant administrators:(F,WDAC) /t
    pushd "<Apply_Directory_Path>" && (rd /s /q "<Apply_Directory_Path>" 2>nul & popd)
    I would reach my initial goal?

    Thanks

    Bye
      My ComputerSystem Spec


 
Page 1 of 2 12 LastLast

Related Threads
Performance & Maintenance Use DISM to Repair Windows 10 Image in Tutorials
How to Repair Windows 10 Image using DISM If a Windows image becomes unserviceable, you can use the Deployment Imaging and Servicing Management (DISM) tool to update the files and correct the problem. For example, you would use DISM to fix...
SFC Scannow or DISM/RestoreHealth using Image in Performance & Maintenance
Windows 10 user. Having some trouble with my system after coming back from a weekend. Nothing major...just having trouble playing some games that require plugins etc Regardless if it's related, I just wanted to run an SFC/Scannow or...
Hi Using the Dism command in Windows ADK for Windows 10 v1511, it is possible to change the name and description of a volume image saved to a wim file? If not, you can tell me the method more proper to do this avoiding the use of the old...
Solved creating usb pen for dism apply-image in Installation and Upgrade
I have managed to create a USB pen drive to apply WIM images using the DISM Apply-image command in 64bit so I know it can be done but any ideas how to create a pen to apply 32bit WIM images
Hi, last few hours I spent trying to manually deploy Windows 10 on clean GPT disk but after applying image and rebooting I always end in unbootable state. I manually setup drive like this: select disk 0 clean convert gpt create partition...
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 04:42.
Find Us