Skip to content

Instantly share code, notes, and snippets.

@ronsen
Last active October 23, 2023 08:13
Show Gist options
  • Save ronsen/dbd9ec3092a517daf83305b769aa52f3 to your computer and use it in GitHub Desktop.
Save ronsen/dbd9ec3092a517daf83305b769aa52f3 to your computer and use it in GitHub Desktop.
#!/bin/python
import os
USER_FONTS_DIR = "C:\\Users\\<USER>\\AppData\\Local\\Microsoft\\Windows\\Fonts\\"
WINDOWS_FONTS_DIR = "C:\\Windows\\Fonts\\"
def main():
for i in os.listdir(USER_FONTS_DIR):
f = WINDOWS_FONTS_DIR + i
if os.path.exists(f):
try:
print("Deleting " + f + " ...")
os.remove(f)
except:
print("Unable to delete " + f)
else:
print("File not found")
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment