Created
September 22, 2019 23:38
-
-
Save infval/e81c938c9799c978b13542e55896172c to your computer and use it in GitHub Desktop.
[Win7] Explorer search history to file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import winreg | |
sub_key = r"SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\WordWheelQuery" | |
history = [] | |
with winreg.OpenKey(winreg.HKEY_CURRENT_USER, sub_key) as key: | |
order, regtype = winreg.QueryValueEx(key, "MRUListEx") | |
ind = 0 | |
while order[ind] != 0xFF: | |
value, regtype = winreg.QueryValueEx(key, str(order[ind])) | |
history.append(value) | |
ind += 4 | |
with open("search_history.txt", "w", encoding="utf-16") as f: | |
for value in history: | |
f.write(value.decode("utf-16")[:-1]) | |
f.write("\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment