Hi
I installed Windows ADK 10 v1511 on Windows 10 v1511 Enterprise 64 bit.
I typed the following commands:Now, what is the command that allows to completely remove the entire content of the <Apply_Directory_Path> directory?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>sourcesinstall.wim" /CaptureDir:"<Apply_Directory_Path>" /Name:"<Edition_name>" /Description:"<Description_name>" /Compress:max /Verify /CheckIntegrity
Thanks
Bye
Do you mean you want to delete everything in the directory but leave the directory itself?
If so this should do itCode: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
You can try to take ownership withand then delete the contents.Code:takeown /f "<Apply_Directory_Path>" /r icacls "<Apply_Directory_Path>" /grant "%USERDOMAIN%\%USERNAME%":(F) /t
You applied the install.wim to the directory... Thus by applying the install.wim - you installed windows (trusted installer)....
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
I await a reply.
Thanks
Bye
acl - How to remove read-only attribute recursively on Windows 7 - Super User
If I write:I reach the same my purpose?Code:takeown /f "<Apply_Directory_Path>" /r icacls "<Apply_Directory_Path>" /grant "%USERDOMAIN%\%USERNAME%":(F,WDAC) /t
Thanks
Bye
In conclusion, if I use the following commandsI would reach my initial goal?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)
Thanks
Bye