Unblock Files & Folders

Post your working scripts, libraries and tools.
iseahound
Posts: 1427
Joined: 13 Aug 2016, 21:04
Contact:

Unblock Files & Folders

Post by iseahound » 25 Sep 2022, 17:45

Removes warning that files came from another computer

Code: Select all

DirUnblock(filepath) {
   Loop Files filepath "\*", 'FR'
      if FileExist(A_LoopFileFullPath ":Zone.Identifier:$DATA")
         FileDelete A_LoopFileFullPath ":Zone.Identifier:$DATA"
}

Code: Select all

FileUnblock(filepath) {
   if FileExist(A_LoopFileFullPath ":Zone.Identifier:$DATA")
      FileDelete A_LoopFileFullPath ":Zone.Identifier:$DATA"
}
If you'd like to do this asynchronously use powershell -command Unblock-File (I think)

Return to “Scripts and Functions (v2)”