Page 1 of 2 12 LastLast
  1.    26 Dec 2015 #1
    Join Date : Jun 2015
    Posts : 278
    Windows 10

    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
    Join Date : Jul 2015
    Posts : 3,820
    10 Pro

    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
    Join Date : Jun 2015
    Posts : 278
    Windows 10
    Thread Starter

    Quote Originally Posted by lx07 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
    Join Date : Jul 2015
    Posts : 3,820
    10 Pro

    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.    26 Dec 2015 #5
    Join Date : Jun 2015
    Posts : 1,929
    Windows 3.1 to Windows 10

    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
    Join Date : Jun 2015
    Posts : 278
    Windows 10
    Thread Starter

    Quote Originally Posted by lx07 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
    Join Date : Jun 2015
    Posts : 278
    Windows 10
    Thread Starter

    I await a reply.

    Thanks

    Bye
      My ComputerSystem Spec
  8.    29 Dec 2015 #8
    Join Date : Jul 2015
    Posts : 3,820
    10 Pro
      My ComputerSystem Spec
  9.    29 Dec 2015 #9
    Join Date : Jun 2015
    Posts : 278
    Windows 10
    Thread Starter

    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
    Join Date : Jun 2015
    Posts : 278
    Windows 10
    Thread Starter

    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


Similar Threads
Thread Forum
Performance & Maintenance Use DISM to 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 Upgrade
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 Upgrade
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 Upgrade
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 05:25.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums