Skip to content

Commit

Permalink
Fix execute script for Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-unwin committed Dec 14, 2018
1 parent ed36ff8 commit 34fc72b
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions other/execute.vbs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ Option Explicit
dim url, objHTTP
dim objArgs, strArg, varArray
Set objArgs = WScript.Arguments
dim method
method = "GET"

for each strArg in objArgs
if instr(strArg, "=") then
Expand All @@ -52,15 +54,24 @@ for each strArg in objArgs
case "url"
url = varArray(1)

case "method"
method = ucase(varArray(1))

end select
end if
next

if url <> "" then
on error resume next
Set objHTTP = WScript.CreateObject("MSXML2.ServerXMLHTTP.3.0")
objHTTP.setTimeouts 5000, 5000, 5000, 120000
objHTTP.SetOption 2, 13056
objHTTP.Open "GET", url, TRUE
on error goto 0
on error resume next
Set objHTTP = WScript.CreateObject("MSXML2.ServerXMLHTTP.3.0")
objHTTP.setTimeouts 5000, 5000, 5000, 120000
objHTTP.SetOption 2, 13056
if method = "GET" then
objHTTP.Open method, url, True
else
objHTTP.Open method, url, False
objHTTP.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
objHTTP.Send "data=1" + vbcrlf
end if
on error goto 0
end if

0 comments on commit 34fc72b

Please sign in to comment.