| ESTIMATED READING TIME: LESS THAN A MINUTE
Feel free to to check out ThioJoe’s video through here.
For those who are interested, here’s the code for unblocking all files in bulk (USE IT ONLY IF YOU KNOW WHAT YOU’RE DOING! ⚠️):
import os
import win32api
import win32con
def unblock_file(file_path):
# Remove the 'Mark of the Web' by clearing the alternate data stream
try:
win32api.SetFileAttributes(file_path, win32con.FILE_ATTRIBUTE_NORMAL)
print(f"Unblocked: {file_path}")
except Exception as e:
print(f"Error unblocking {file_path}: {e}")
def unblock_files_in_partition(partition):
for root, dirs, files in os.walk(partition):
for file in files:
unblock_file(os.path.join(root, file))
# You can add/remove partitions below
partitions = ['C:\\', 'D:\\', 'E:\\', 'F:\\', 'G:\\', 'H:\\', 'I:\\', 'J:\\']
for partition in partitions:
unblock_files_in_partition(partition)
Instead of scouring drives, trying to unblock every single file you come across individually, the script below can be used to unblock every single file that has the so-called mark of the web.