Advertisement
James1337

FileSetZoneIdentifier

Aug 30th, 2012
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.55 KB | None | 0 0
  1. Func FileSetZoneIdentifier($Filename, $ZoneId=0)
  2.     Local $File = FileOpen($Filename & ":Zone.Identifier:$DATA",  2)
  3.     FileWrite($File, "[ZoneTransfer]" & @CRLF & "ZoneId=" & $ZoneId)
  4.     FileClose($File)
  5. EndFunc
  6.  
  7. Func DirSetZoneIdentifier($path, $ZoneId=0)
  8.     Local $search = FileFindFirstFile($path & "*.exe"), $file
  9.     If $search = -1 Then Return False
  10.     Do
  11.         $file = FileFindNextFile($search)
  12.         If @error Then ExitLoop
  13. ;~      MsgBox(64, "", $path & $file)
  14.         FileSetZoneIdentifier($path & $file, $ZoneId)
  15.     Until False
  16.     FileClose($search)
  17.     Return True
  18. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement