Delete System Folders from designated folder

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Jamin6900
Posts: 1
Joined: 03 Sep 2016 11:43

Delete System Folders from designated folder

#1 Post by Jamin6900 » 03 Sep 2016 11:49

Can anyone assist with getting the following command to also delete System Protected Files?

*
taskkill /F /IM iexplore.exe

choice /C X /T 5 /D X > nul

set folder="%USERPROFILE%\Appdata\Local\Microsoft\Internet Explorer"

cd /d %folder%

for /F "delims=" %%i in ('dir /b') do (rmdir "%%i" /s/q || del "%%i" /s/q)

*
IE can be such a pain, and really I need the system folders to be deleted to get rid of old deprecated Internet Explorer Maintenance information and wiping the system folders is the only way to accomplish that.

Scripting is not my strongest suit and I have tried everything I can find to get some sort of System folders/files to delete within the target, all have failed.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Delete System Folders from designated folder

#2 Post by foxidrive » 04 Sep 2016 02:11

Jamin6900 wrote:Can anyone assist with getting the following command to also delete System Protected Files?

IE can be such a pain, and really I need the system folders to be deleted to get rid of old deprecated Internet Explorer Maintenance information and wiping the system folders is the only way to accomplish that.


In Modern windows you need to change the permissions of the folders, and that can even be impossible in some cases as Windows has been written to be far more robust against malware and hacking.

There are these system tools you can use to change permissions.

icacls.exe
takeown.exe

Post Reply