I would like to send an automatic url request, using a VBS or a BATCH file. The request will have this structure : http://myServeurIP/Test/?name=ezioauditore
I found this post, to help me : Open a URL without using a browser from a batch file
@if (@This==@IsBatch) @then
@echo off
rem **** batch zone *********************************************************
setlocal enableextensions disabledelayedexpansion
rem Batch file will delegate all the work to the 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 the needed component to make url queries
var http = WScript.CreateObject('Msxml2.XMLHTTP.6.0');
// Retrieve the url parameter
var url = WScript.Arguments.Item(0)
// Make the request
http.open("GET", url, false);
http.send();
// All done. Exit
WScript.Quit(0);
But I don't understand. What is "%~1"==""
?
I put my URL in http.send(http://myServeurIP/Test/);
. Is it correct ?
Also I have no visibility if it works or not.
Can you help me understand this script ?