I want to delete a huge amount of files via PowerShell. I want to use a terminal, because my Explorer crashes if I try to delete or access the folder.
It is an INetCache folder from Windows ("C:\Windows\SysWOW64\config\systemprofile\AppData\Local\Microsoft\Windows\INetCache\IE") same for system32.
With the good old cmd I was able to see what is actually in the folder, and there are ~10gb of 0.5 - 1.5 kbit *.htm files. (~8 million files)
Can I use / Are there .net libs for file operations that do not enforce enumerations? all I found in ps is, that most programs are just aliases to .net lib based programs. otherwise I would have to rely on a *.bat file...
Maybe I oversee an easy solution?
What I tried:
Remove-Item
del
(alias Remove-Item)rm
(alias Remove-Item)robocopy
(mirror from an empty directory to the target directory)- Windows Explorer delete (+ shift pressed)
Everything I executed from the PowerShell against the directory froze the session. I think this is because the programs try to enumerate the contents of the directory.
Solutions:
- A "I dont like it, but it works" solution is using the delete program from the cmd.exe .