{
	"id": "e52a8cc6-381e-41af-b330-81f1f9e2dac8",
	"created_at": "2026-04-06T00:11:38.332223Z",
	"updated_at": "2026-04-10T13:12:20.992316Z",
	"deleted_at": null,
	"sha1_hash": "4e9cda0c44f40a06e04747f1b9f4a93f256cacea",
	"title": "Running Scripts",
	"llm_title": "",
	"authors": "",
	"file_creation_date": "0001-01-01T00:00:00Z",
	"file_modification_date": "0001-01-01T00:00:00Z",
	"file_size": 47925,
	"plain_text": "Running Scripts\r\nArchived: 2026-04-05 18:49:29 UTC\r\nMore complicated scripts can introduce functions. These are usually placed towards the end of a script or below\r\nthe Global variable declaration section.\r\nMsgBox($MB_SYSTEMMODAL, \"My second script!\", \"Hello from the main script!\") Example_Func() Func\r\nExample_Func() Return MsgBox($MB_SYSTEMMODAL, \"My Second Script!\", \"Hello from the functions!\")\r\nEndFunc ;==\u003eExample_Func @@End@@\r\nCommand Line Parameters\r\nPassing command line parameters to your own executable is achievable in AutoIt. Passed commandline\r\nparameters can be viewed by using the constant variables $CmdLine and $CmdLineRaw. Assigning these\r\nvariables with new data will cause AutoIt to return an error, as these cannot be changed during the script's\r\nexecution. Note that both variables exist whether commandline parameters are passed or not.\r\nThe special array $CmdLine is initialized at the start of the script with the command line parameters passed to\r\nyour AutoIt script. If running your script instead of the executable, then the ScriptName.au3 willl be ignored as a\r\nparameter.\r\nIf you're passing strings with spaces, then you will need to escape these using \"double quotes\" in your\r\ncommandline string.\r\n@@SyntaxHighlighting@@ $CmdLine[0] ; Contains the total number of items in the array. $CmdLine[1] ; The\r\nfirst parameter. $CmdLine[2] ; The second parameter. ... $CmdLine[nth] ; The nth parameter e.g. 10 if the array\r\ncontains 10 items. @@End@@\r\nSo if you were to run your script directly using AutoIt3.exe:\r\n@@SyntaxHighlighting@@ AutoIt3.exe myScript.au3 param1 \"This is a string parameter\" 99 @@End@@\r\n@@SyntaxHighlighting@@ $CmdLine[0] ; This contains 3 parameters. $CmdLine[1] ; This contains param1 and\r\nnot myScript.au3 as this is ignored when running non-compiled. $CmdLine[2] ; This contains This is a string\r\nparameter. $CmdLine[3] ; This contains 99. $CmdLineRaw ; This contains myScript.au3 param1 \"This is a string\r\nparameter\" 99. @@End@@\r\nSo if you were to use the compiled executable by passing commandline parameters:\r\n@@SyntaxHighlighting@@ myProg.exe param1 \"This is a string parameter\" 99 @@End@@\r\n@@SyntaxHighlighting@@ $CmdLine[0] ; This contains 3 parameters. $CmdLine[1] ; This contains param1.\r\n$CmdLine[2] ; This contains This is a string parameter. $CmdLine[3] ; This contains 99. @@End@@\r\nAutoIt specific command Line Switches\r\nThe AutoIt3.exe interpreter, or the interpreter stub of any compiled Autoit script, can normally be used to run\r\nAutoIt scripts directly from the command line.  In all cases the /ErrorStdOut switch allows the redirection of a\r\nhttps://www.autoitscript.com/autoit3/docs/intro/running.htm\r\nPage 1 of 3\n\nfatal error to StdOut which can then be captured by an application such as the SciTE editor. This switch can be\r\nused with both the interpreter and a compiled script.\r\nRun a script using the interpreter: \r\nAutoIt3.exe [/ErrorStdOut] [/AutoIt3ExecuteScript] filename [params ...]                 Execute the AutoIt3 script\r\n'filename' with optional parameters\r\nAt its simplest: AutoIt3.exe myScript.au3 will run a standard AutoIt script 'myScript.au3' with no parameters.\r\nRun a compiled script:\r\nCompiled.exe [/ErrorStdOut] [params ...]\r\n                Execute a compiled AutoIt3 Script File produced with Aut2Exe.\r\nRun a single line of code:\r\nAutoIt3.exe [/ErrorStdOut] /AutoIt3ExecuteLine \"command line\"\r\n                Execute one line of code.\r\nThe command below will execute that single line of code and display the MsgBox with \"Hello World!\". The tray\r\nicon will not be displayed. \r\n@@SyntaxHighlighting@@ Run(@AutoItExe \u0026 ' /AutoIt3ExecuteLine \"MsgBox(4096, ''Hello World!'', ''Hi!'')\"')\r\n@@End@@\r\nRun a script using another compiled script:\r\nCompiled.exe [/ErrorStdOut] /AutoIt3ExecuteScript file [params ...]\r\n                Execute another AutoIt script file from a compiled AutoIt3 executable. \r\nCompiled.exe [/ErrorStdOut] /AutoIt3ExecuteLine \"command line\"\r\n                Execute one line of code as with AutoIt3.exe above. \r\nThis means that there is no need to have a copy of AutoIt3.exe in addition to the compiled file - the interpreter\r\nstub of the compiled file will replace it.  So as long as there is at least one compiled script available, other AutoIt\r\nscripts can be run without the need to have AutoIt3.exe on the machine., either pre-installed or added via\r\nFileInstall.\r\nImportant Notes\r\nHowever, the executable must have been compiled with the #pragma compile(AutoItExecuteAllowed, True)\r\ndirective as the default setting does not permit use of the /AutoItExecuteScript or /AutoItExecuteLine parameters.\r\nMoreover, since the interpreter stub searches for any required standard #include files in its current folder, UDF\r\nfunctions and various constants may not be available as those files are normally only found in the full AutoIt\r\ninstall. It is therefore recommended that any scripts intended to be run in this manner are compiled to the .a3x\r\nformat rather then being left as plain .au3 text files\r\nhttps://www.autoitscript.com/autoit3/docs/intro/running.htm\r\nPage 2 of 3\n\nCorrect usage of single and double quotation marks is important when using the command line - even for double\r\nsingle quotation marks.\r\nSource: https://www.autoitscript.com/autoit3/docs/intro/running.htm\r\nhttps://www.autoitscript.com/autoit3/docs/intro/running.htm\r\nPage 3 of 3",
	"extraction_quality": 1,
	"language": "EN",
	"sources": [
		"MITRE"
	],
	"origins": [
		"web"
	],
	"references": [
		"https://www.autoitscript.com/autoit3/docs/intro/running.htm"
	],
	"report_names": [
		"running.htm"
	],
	"threat_actors": [],
	"ts_created_at": 1775434298,
	"ts_updated_at": 1775826740,
	"ts_creation_date": 0,
	"ts_modification_date": 0,
	"files": {
		"pdf": "https://archive.orkl.eu/4e9cda0c44f40a06e04747f1b9f4a93f256cacea.pdf",
		"text": "https://archive.orkl.eu/4e9cda0c44f40a06e04747f1b9f4a93f256cacea.txt",
		"img": "https://archive.orkl.eu/4e9cda0c44f40a06e04747f1b9f4a93f256cacea.jpg"
	}
}