I'm using a batch file to check the status of a mysql site. Right now everything works great on the sites side so that when I connect to it it'll say something like User is Online
or Offline
. In need a batch file to call the url and save the output of the page to a text file. This post does what I am asking without saving the output: Open a URL without using a browser from a batch file . It can be a vbscript as long as it can be called via a batch file. Thanks a bunch!
Origional Script from post above:
@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);