止まない雨はない

もやもやしていることをすっきりさせたい。明日にはすっきりしているはず。

VBSによるUnblock-File

インターネット等からDLしたファイルのセキュリティ設定を解除するPowershellコマンドを
VBSによるツール化し、かつD&Dで解除できるようにしたもの。

docs.microsoft.com

Option Explicit
Dim wsh
Dim GetPath
Dim path
Dim OPT

Set wsh = CreateObject("wscript.shell")
Set GetPath = WScript.Arguments

OPT = "Powershell -Command Unblock-File" 

For Each path in GetPath
    wsh.Run OPT & " " & "'" & path & "'"
next

Set GetPath = Nothing
Set wsh = Nothing

wscript.quit

プロパティの許可する部分を一括で処理できるようになります。
f:id:lnnlnnl:20220206233213p:plain