Skip to content

Instantly share code, notes, and snippets.

@narze
Created August 3, 2015 11:31
Show Gist options
  • Select an option

  • Save narze/7007fcd203925c9757cc to your computer and use it in GitHub Desktop.

Select an option

Save narze/7007fcd203925c9757cc to your computer and use it in GitHub Desktop.
@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", "http://192.168.4.1/close", false);
http.send();
// All done. Exit
WScript.Quit(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment