javascript - How to send an url request using VBS or BAT script -


i send automatic url request, using vbs or batch file. request have structure : http://myserveurip/test/?name=ezioauditore

i found post, me : open url without using browser batch file

@if (@this==@isbatch) @then @echo off rem **** batch zone *********************************************************      setlocal enableextensions disabledelayedexpansion      rem batch file delegate work script engine      if not "%~1"=="" (         wscript //e:jscript "%~dpnx0" %1     )      rem end of batch area. ensure batch ends execution before reaching     rem javascript zone     exit /b  @end // **** javascript zone ***************************************************** // instantiate needed component make url queries var http = wscript.createobject('msxml2.xmlhttp.6.0');  // retrieve url parameter var url = wscript.arguments.item(0)      // make request      http.open("get", url, false);     http.send();      // done. exit     wscript.quit(0); 

but don't understand. "%~1"=="" ? put url in http.send(http://myserveurip/test/);. correct ? have no visibility if works or not.

can me understand script ?

everything above @end not specific problem @ hand ... it's way of making script runnable either batch file, or script directly.

if want hard-code url in script , running explicit "wscript.exe _script_ //e:jscript", can lot shorter, following...

var http = wscript.createobject('msxml2.xmlhttp.6.0'); http.open("get", "http://myserveurip/test/", false); http.send(); wscript.quit(0); 

Comments