Page 1 of 2 12 LastLast

  1. Joined : Jun 2015
    Posts : 213
    Windows 10
       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 System SpecsSystem 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 System SpecsSystem Spec


  3. Joined : Jun 2015
    Posts : 213
    Windows 10
       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 System SpecsSystem 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 System SpecsSystem Spec


  5. Joined : Jun 2015
    Posts : 1,604
    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 System SpecsSystem Spec


  6. Joined : Jun 2015
    Posts : 213
    Windows 10
       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 System SpecsSystem Spec


  7. Joined : Jun 2015
    Posts : 213
    Windows 10
       29 Dec 2015 #7

    I await a reply.

    Thanks

    Bye
      My System SpecsSystem Spec

  8.   My System SpecsSystem Spec


  9. Joined : Jun 2015
    Posts : 213
    Windows 10
       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 System SpecsSystem Spec


  10. Joined : Jun 2015
    Posts : 213
    Windows 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 System SpecsSystem Spec


 
Page 1 of 2 12 LastLast


Similar Threads
Thread Forum
DISM - Repair Windows 10 Image
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...
Tutorials
SFC Scannow or DISM/RestoreHealth using Image
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...
Performance & Maintenance
Change the name and description of a volume image using the Dism
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...
Installation and Setup
Solved creating usb pen for dism apply-image
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
Installation and Setup
Apple MBP: UEFI installation won't boot after image apply
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...
Installation and Setup
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 21:26.
Find Us
Twitter Facebook Google+



Windows 10 Forums