Powershell Script to delete specific cookie


  • Hello,

    I want to delete few specific cookies ( Dont want to delete all) using batch file. Could someone please give me a powershell script which does this job.


    • Moved by Santosh Bhandarkar Monday, August 26, 2013 7:36 AM Moved from Server General Forum
    Sunday, August 25, 2013 5:20 AM


  • Hi,

    We could first find those cookies stored path, use select-string to find out what kind of cookies you want to remove, and then use remove-item command to delete them, please refer to the below link:


    Yan Li

    Cataleya Li
    TechNet Community Support

    Monday, August 26, 2013 6:42 AM
  • get-childitem "C:\Users\testuser1\AppData\Local\Microsoft\Windows\Temporary Internet Files\*" -include * -recurse -force | ? {$ -match "videoplayback"} | Remove-item -force -recurse 

    The above tested on the win7 machine. Change the location and matching criteria.

    The below is the single command to remove the browser history.

    RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 8

    Thanks Azam When you see answers please Mark as Answer if as helpful.

    Monday, August 26, 2013 12:46 PM

All replies