Last active
September 30, 2023 20:07
-
-
Save gffcoutinho/e5253ee66c8239ece863 to your computer and use it in GitHub Desktop.
This file contains 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 (true == false) @end /* | |
@echo off | |
cscript //nologo //e:javascript "%~dpnx0" %* | |
pause | |
goto :EOF */ | |
WScript.Echo('Hello from JScript'); |
This file contains 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
<!-- : | |
@echo off | |
mshta.exe "%~f0" %* | |
exit /b | |
rem | |
--> | |
<html> | |
<head> | |
<title>Command Line Agruments</title> | |
<HTA:APPLICATION | |
ID="objTestHTA" | |
APPLICATIONNAME="Command Line Agruments" | |
SINGLEINSTANCE="yes" | |
> | |
</head> | |
<SCRIPT Language="VBScript"> | |
alert(objTestHTA.commandLine) | |
Sub Window_onLoad | |
arrCommands = Split(objTestHTA.commandLine, chr(34)) | |
For i = 3 to (Ubound(arrCommands) - 1) Step 2 | |
Msgbox arrCommands(i) | |
Next | |
End Sub | |
</SCRIPT> | |
<body> | |
</body> | |
</html> |
This file contains 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
<!-- : | |
@echo off | |
start "" mshta.exe "%~f0" | |
exit /b | |
--> | |
<html> | |
<head><title>HTA window</title></head> | |
<body><h1>Hello, world!</h1></body> | |
</html> |
This file contains 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(0)==(0) ECHO OFF | |
start wscript.exe //nologo //E:JScript "%~f0" %* | |
GOTO :EOF | |
@end | |
var ws = WScript.createobject('wscript.shell'); | |
var getXmlHttp = (function() { | |
if (undefined != XMLHttpRequest) { | |
return function() { | |
return new XMLHttpRequest(); | |
}; | |
} else { | |
return function() { | |
return new ActiveXObject("Microsoft.XMLHTTP"); | |
}; | |
} | |
})(); | |
ws.Exec("control desk.cpl") | |
WScript.Sleep( 1000 ); | |
ws.SendKeys("%l") | |
WScript.Sleep( 500 ); | |
ws.SendKeys("%a") | |
WScript.Sleep( 500 ); | |
ws.SendKeys("{ESC}"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment