header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Remove IE browsing cache...
Last Post 25 Oct 2011 12:18 AM by Bobdee. 2 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
BobdeeUser is Offline
Basic Member
Basic Member
Posts:130
Avatar

--
24 Oct 2011 07:48 AM
    Hi,

    Can anyone point me in the right direction of deleting IE browsing history using PS?

    I'm finding that I can browse to the directory of the cache, but PS can't see anything there to list, or delete.  Here's the line I have 

    gci "C:\Users\me\AppData\Local\Microsoft\IE Temporary Internet Files\Temporary Internet Files\*" -recurse -force | foreach { Remove-Item -recurse -force}

    I'm  thrown back an error stating that the Temporary internet Files directory does not exist when I use this.

    If I then do a set-location to the directory it's fine - but I can't list what is in there for some reason.

    All I really want to do is add a function to my PS profile that will allow me to simply run 'remove-tifs' in a console to delete any browser cache (since I use several browsers, it's quicker that way).

    Can anyone help??

    Thanks in advance.

    Rob
    Marco ShawUser is Offline
    Veteran Member
    Veteran Member
    Posts:1684
    Avatar

    --
    24 Oct 2011 02:28 PM
    **Not tested**

    Now, I think you're problem is that you've dropped this in a foreach, when you shouldn't have:
    gci "C:\Users\me\AppData\Local\Microsoft\IE Temporary Internet Files\Temporary Internet Files\*" -recurse -force | foreach { Remove-Item -recurse -force}

    Consider instead simply:
    gci "C:\Users\me\AppData\Local\Microsoft\IE Temporary Internet Files\Temporary Internet Files\*" -recurse -force | Remove-Item -recurse -force

    By adding a foreach, you're changing how the pipeline works. I'm not sure how that will react to files, since you have the -recurse flag on Remove-Item.

    If you really want the foreach, you have to change to something like:
    gci "C:\Users\me\AppData\Local\Microsoft\IE Temporary Internet Files\Temporary Internet Files\*" -recurse -force | foreach { Remove-Item $_.fullpath -recurse -force}
    BobdeeUser is Offline
    Basic Member
    Basic Member
    Posts:130
    Avatar

    --
    25 Oct 2011 12:18 AM
    Hi Marco. I understand what you are saying, but what I am finding is that PS (or normal command line dir) cannot see the cached TIFs. I know that there are definitely files in there. If I remove the pipe and just GCI the directory, nothing is returned.

    Try it - can you return anything using a simple gci? Maybe it's my machine...
    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer