Created
August 3, 2015 11:31
-
-
Save narze/7007fcd203925c9757cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @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