Created
February 12, 2018 14:19
-
-
Save mitaken/b464928bb30f76bae4a0801f38f2ce09 to your computer and use it in GitHub Desktop.
Drag and Drop zone protected files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
Call WScript.Quit(Main()) | |
Function Main() | |
Dim ObjShell, ObjResult, ObjStdIn | |
Set ObjShell = WScript.CreateObject("WScript.Shell") | |
Set ObjResult = ObjShell.Exec("powershell -NoLogo -Command -") | |
Set ObjStdIn = ObjResult.StdIn | |
Dim ObjArgs, StrArgs, StrCmd | |
Set ObjArgs = WScript.Arguments | |
For Each StrArgs In ObjArgs | |
StrCmd = "Unblock-File -LiteralPath """ & StrArgs & """" | |
Call Debug.WriteLine(StrCmd) | |
Call ObjStdIn.WriteLine(StrCmd) | |
Next | |
Set ObjArgs = Nothing | |
Call ObjStdIn.Close() | |
Set ObjStdIn = Nothing | |
Main = ObjResult.ExitCode | |
Set ObjResult = Nothing | |
Set ObjShell = Nothing | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment