Skip to content

Instantly share code, notes, and snippets.

@RadAd
Created April 9, 2015 02:51
Show Gist options
  • Save RadAd/33c2f9f0737e6f39edbf to your computer and use it in GitHub Desktop.
Save RadAd/33c2f9f0737e6f39edbf to your computer and use it in GitHub Desktop.
List all ie cookies
Set wshShell = CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
'http://weitips.blogspot.com.au/2006/04/cookie-file-format-of-internet.html
'http://nirsoft.net/utils/internet_explorer_cookies_view.html
Name = ""
Value = ""
Host = ""
Sub ReadData(file)
Name = ""
Value = ""
Host = ""
On Error Resume Next
Set objReadFile = objFSO.OpenTextFile(file, 1)
Name = objReadFile.ReadLine
Value = objReadFile.ReadLine
Host = objReadFile.ReadLine
objReadFile.Close
On Error GoTo 0
End Sub
Sub DoDir(dir)
Set objFolder = objFSO.GetFolder(dir)
For Each objFile in objFolder.Files
ReadData(objFile.Path)
WScript.Echo Host & ":" & Name & "=" & Value
Next
End Sub
DoDir(wshShell.ExpandEnvironmentStrings("%APPDATA%\Microsoft\Windows\Cookies"))
DoDir(wshShell.ExpandEnvironmentStrings("%APPDATA%\Microsoft\Windows\Cookies\Low"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment