├── BugReport └── README.md ├── CodingGuide ├── CommandOp.md ├── Migrating.md └── README.md ├── Commands ├── Archive │ ├── Compress.md │ ├── CopyOrExpand.md │ ├── Decompress.md │ ├── Expand.md │ └── README.md ├── Branch │ ├── Break.md │ ├── Continue.md │ ├── Exec.md │ ├── ForEach.md │ ├── ForRange.md │ ├── If-Else.md │ ├── If-Question.md │ ├── If.md │ ├── Loop.md │ ├── LoopLetter.md │ ├── Operators.md │ ├── README.md │ ├── Run.md │ ├── RunEx.md │ └── While.md ├── Control │ ├── AddVariables.md │ ├── Beep.md │ ├── Exit.md │ ├── GetParam.md │ ├── Halt.md │ ├── README.md │ ├── Return.md │ ├── Set.md │ ├── SetMacro.md │ └── Wait.md ├── Deprecated.md ├── File │ ├── DirCopy.md │ ├── DirDelete.md │ ├── DirMake.md │ ├── DirMove.md │ ├── DirSize.md │ ├── FileCopy.md │ ├── FileCreateBlank.md │ ├── FileDelete.md │ ├── FileRename.md │ ├── FileSize.md │ ├── FileVersion.md │ ├── PathMove.md │ └── README.md ├── Hash │ ├── Hash.md │ └── README.md ├── INI │ ├── IniAddSection.md │ ├── IniCompact.md │ ├── IniDelete.md │ ├── IniDeleteSection.md │ ├── IniMerge.md │ ├── IniRead.md │ ├── IniReadSection.md │ ├── IniWrite.md │ ├── IniWriteTextLine.md │ └── README.md ├── Interface │ ├── AddInterface.md │ ├── Echo.md │ ├── EchoFile.md │ ├── Message.md │ ├── README.md │ ├── ReadInterface.md │ ├── UserInput.md │ ├── Visible.md │ └── WriteInterface.md ├── List │ ├── Append.md │ ├── Count.md │ ├── Get.md │ ├── Insert.md │ ├── LastPos.md │ ├── LastPosX.md │ ├── Pos.md │ ├── PosX.md │ ├── README.md │ ├── Range.md │ ├── Remove.md │ ├── RemoveAt.md │ ├── RemoveX.md │ ├── Set.md │ ├── Sort.md │ ├── SortN.md │ ├── SortNX.md │ └── SortX.md ├── Math │ ├── Abs.md │ ├── Add.md │ ├── BitAnd.md │ ├── BitNot.md │ ├── BitOr.md │ ├── BitShift.md │ ├── BitXor.md │ ├── BoolAnd.md │ ├── BoolNot.md │ ├── BoolOr.md │ ├── BoolXor.md │ ├── Ceil.md │ ├── Dec.md │ ├── Div.md │ ├── Floor.md │ ├── FromChar.md │ ├── Hex.md │ ├── IntDiv.md │ ├── Mul.md │ ├── Neg.md │ ├── Pow.md │ ├── README.md │ ├── Rand.md │ ├── Round.md │ ├── Sub.md │ ├── ToChar.md │ ├── ToSign.md │ └── ToUnsign.md ├── Network │ ├── README.md │ └── WebGet.md ├── README.md ├── Registry │ ├── README.md │ ├── RegCopy.md │ ├── RegDelete.md │ ├── RegExport.md │ ├── RegHiveLoad.md │ ├── RegHiveUnload.md │ ├── RegImport.md │ ├── RegMulti.md │ ├── RegRead.md │ ├── RegWrite.md │ └── RegWriteEx.md ├── Script │ ├── Encode.md │ ├── ExtractAllFiles.md │ ├── ExtractAndRun.md │ ├── ExtractFile.md │ └── README.md ├── String │ ├── BytesToInt.md │ ├── CTrim.md │ ├── Ceil.md │ ├── Date.md │ ├── Dec.md │ ├── DirPath.md │ ├── Div.md │ ├── Ext.md │ ├── FileName.md │ ├── Floor.md │ ├── Hex.md │ ├── Inc.md │ ├── IntToBytes.md │ ├── LCase.md │ ├── LTrim.md │ ├── Left.md │ ├── Len.md │ ├── LongPath.md │ ├── Mid.md │ ├── Mult.md │ ├── NTrim.md │ ├── PadLeft.md │ ├── PadRight.md │ ├── PathCombine.md │ ├── Pos.md │ ├── PosX.md │ ├── README.md │ ├── RTrim.md │ ├── Replace.md │ ├── ReplaceX.md │ ├── Right.md │ ├── Round.md │ ├── ShortPath.md │ ├── Split.md │ └── UCase.md ├── System │ ├── Cursor.md │ ├── EndLocal.md │ ├── ErrorOff.md │ ├── GetEnv.md │ ├── GetFreeDrive.md │ ├── GetFreeSpace.md │ ├── IsAdmin.md │ ├── LoadNewScript.md │ ├── OnBuildExit.md │ ├── OnScriptExit.md │ ├── README.md │ ├── RefreshAllScripts.md │ ├── RefreshInterface.md │ ├── RefreshScript.md │ ├── SaveLog.md │ ├── SetLocal.md │ ├── ShellExecute.md │ ├── ShellExecuteDelete.md │ └── ShellExecuteEx.md ├── Text │ ├── README.md │ ├── TXTAddLine.md │ ├── TXTDelEmptyLines.md │ ├── TXTDelLine.md │ ├── TXTDelSpaces.md │ └── TXTReplace.md └── WIM │ ├── README.md │ ├── WimAppend.md │ ├── WimApply.md │ ├── WimCapture.md │ ├── WimDelete.md │ ├── WimExport.md │ ├── WimExtract.md │ ├── WimExtractBulk.md │ ├── WimInfo.md │ ├── WimMount.md │ ├── WimOptimize.md │ ├── WimPathAdd.md │ ├── WimPathDelete.md │ ├── WimPathRename.md │ └── WimUnmount.md ├── GUIControls ├── Bevel.md ├── Button.md ├── CheckBox.md ├── ComboBox.md ├── FileBox.md ├── Image.md ├── NumberBox.md ├── PathBox.md ├── README.md ├── RadioButton.md ├── RadioGroup.md ├── TextBox.md ├── TextFile.md ├── TextLabel.md └── WebLabel.md ├── LICENSE ├── LangRef ├── Comments.md ├── Macros.md ├── Sections.md ├── Syntax.md └── Variables.md ├── Projects ├── FolderFiles.md ├── LinkFiles.md ├── ProjectFiles.md ├── ProjectMain.md ├── ProjectProcess.md ├── ProjectUpdate.md ├── ProjectVariables.md ├── README.md ├── ScriptFiles.md ├── ScriptInterface.md ├── ScriptLevels.md ├── ScriptMain.md ├── ScriptProcess.md ├── ScriptUpdate.md └── ScriptVariables.md ├── README.md └── Usage ├── CommandLine.md ├── Logs.md ├── ProjectUpdate.md ├── README.md ├── ScriptUpdate.md ├── Settings-Compatibility.md ├── Settings-General.md ├── Settings-Interface.md ├── Settings-Log.md ├── Settings-Projects.md ├── Settings-Script.md ├── Settings-Theme.md ├── UpdateServer.md └── Utilities.md /BugReport/README.md: -------------------------------------------------------------------------------- 1 | # Bug Report 2 | 3 | To report bugs, please open a new issue in [issue tracker](https://github.com/ied206/PEBakery/issues). 4 | 5 | When reporting, please provide informations and files which can reproduce issue. 6 | 7 | ## Log Debug Level 8 | 9 | Maximum `Log Debug Level` helps developer to track which part of PEBakery is buggy. 10 | 11 | In PEBakery's `Setting`, open `Logging` tab. Set `Log Debug Level` to `PrintExceptionStackTrace`. Then repoduce the issue. 12 | 13 | ## Export Log 14 | 15 | Open PEBakery's `Log Viewer`, goto `Build Log` tab and select a build where bug was found. 16 | 17 | Click `Export` button to save log into file. For debugging, `.txt` format is preferred. 18 | 19 | ## Reproducible Script Sample 20 | 21 | Please upload `.script file` which can reproduce a bug. 22 | 23 | ## Screenshot 24 | 25 | If you can, please provide a screenshot of a bug. 26 | -------------------------------------------------------------------------------- /CodingGuide/README.md: -------------------------------------------------------------------------------- 1 | # Coding Guide 2 | 3 | ## Syntax Checking 4 | 5 | PEBakery supports automatic syntax checking. 6 | 7 | ### Manually Checking Statements or Section 8 | 9 | Copy codes into `Syntax Checker` provided in `Utilities`. 10 | 11 | ### Manually Checking a Single Script 12 | 13 | Make sure your script is visible in project tree. Open script's interface, and click the question button near script title. 14 | 15 | If `Auto Syntax Check Error` setting is enabled, the button's icon and color reports if error exists. 16 | 17 | ## Command Optimization 18 | 19 | See [Command Optimization](./CommandOp.md) -------------------------------------------------------------------------------- /Commands/Archive/CopyOrExpand.md: -------------------------------------------------------------------------------- 1 | # CopyOrExpand 2 | 3 | Copy or Extract files from a Microsoft Cabinet Archive (*.CAB). 4 | 5 | If the source file exists, it will be copied to the `DestPath`. Otherwise, PEBakery will search for a compressed cabinet (*.ex_, *.dl_) and extract the file. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | CopyOrExpand,,,[PRESERVE],[NOWARN] 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | SrcFile | The full path of the file to copy. Wildcards (*, ?) can be used to CopyOrExpand multiple files. | 18 | | DestPath | The full path where the file will be copied or extracted. | 19 | 20 | ### Flags 21 | 22 | | Flag | Description | 23 | | --- | --- | 24 | | PRESERVE | Do not overwrite existing files. | 25 | | NOWARN | Do not log an overwrite warning if a file is overwritten. | 26 | 27 | Flags can be specified in any order. 28 | 29 | ## Remarks 30 | 31 | PEBakery searches for files in the following order: 32 | 33 | 1. Copy 34 | 1. Expand 35 | 36 | This command is mainly used to extract compressed EXE (\*.EX\_) and DLL (\*.DL\_) files from NT5 (WindowsXP) sources. 37 | 38 | Expansion is performed using [7-Zip](https://www.7-Zip.org). 39 | 40 | ## Related 41 | 42 | [Expand](./Expand.md) 43 | 44 | ## Examples 45 | 46 | ```pebakery 47 | // If EXPLORER.EXE exists, it will be copied to %DestDir%. 48 | // If EXPLORER.EXE does not exist, EXPLORER.EXE will be extracted from EXPLORER.EX_. 49 | CppyOrExpand,%SrcDir%\EXPLORER.EXE,%DestDir% 50 | ``` 51 | 52 | ```pebakery 53 | // If EXPLORER.EXE exists, it will be copied to %DestDir% with the new name NEWEXP.EXE. 54 | // If EXPLORER.EXE does not exist, EXPLORER.EXE will be extracted from EXPLORER.EX_ with the new name NEWEXP.EXE. 55 | CppyOrExpand,%SrcDir%\EXPLORER.EXE,%DestDir%\NEWEXP.EXE 56 | ``` 57 | -------------------------------------------------------------------------------- /Commands/Archive/Decompress.md: -------------------------------------------------------------------------------- 1 | # Decompress 2 | 3 | Extract files from an archive. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Decompress,,[,Password=] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | Full path of the archive to extract. | 16 | | DestDir | Full path to the directory where the archive will be extracted. If the directory does not exist it will be created. | 17 | | Password= | **(Optional)** If the archive is encrypted supply the plain-text password that will used to extract the files. | 18 | 19 | ## Supported Archive Formats 20 | 21 | 7z, APM, AR, ARJ, BZIP2, CAB, CHM, CPIO, CramFS, DEB, DMG, EXT, FAT, GPT, GZIP, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, TAR, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR, XZ, Z, ZIP 22 | 23 | **Note:** Only `7z`, `CAB`, `RAR`, and `ZIP` are officially tested. 24 | 25 | Split archives are supported. 26 | 27 | Extracting from encrypted/password protected archives is supported using the `Password=` argument. 28 | 29 | ## Remarks 30 | 31 | Decompression is performed using [7-Zip](https://www.7-Zip.org). 32 | 33 | ## Related 34 | 35 | [Compress](./Compress.md) 36 | 37 | ## Example 38 | 39 | ```pebakery 40 | // Setting.7z will be extracted to %DestDir%. 41 | Decompress,%SrcDir%\Setting.7z,%DestDir% 42 | ``` 43 | -------------------------------------------------------------------------------- /Commands/Archive/Expand.md: -------------------------------------------------------------------------------- 1 | # Expand 2 | 3 | Extract files from a Microsoft Cabinet Archive (*.CAB). 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Expand,,,[FileName],[PRESERVE],[NOWARN] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | CabFile | The full path of the cabinet file to extract. | 16 | | DestDir | Directory where the files will be extracted. | 17 | | FileName | **(Optional)** Extract only this specific file. | 18 | 19 | ### Flags 20 | 21 | | Flag | Description | 22 | | --- | --- | 23 | | PRESERVE | **(Optional)** Do not overwrite existing files when `SingleFile` is specified. | 24 | | NOWARN | **(Optional)** Do not log an overwrite warning if a file is overwritten when extracting a single file. | 25 | 26 | Flags can be specified in any order. 27 | 28 | ## Remarks 29 | 30 | This command is mainly used to extract compressed EXE (\*.EX\_) and DLL (\*.DL\_) files from NT5 (WindowsXP) sources. 31 | 32 | Expansion is performed using [7-Zip](https://www.7-Zip.org). 33 | 34 | ## Related 35 | 36 | [CopyOrExpand](./CopyOrExpand.md) 37 | 38 | ## Examples 39 | 40 | ```pebakery 41 | // ex1.cab will be decompressed into %DestDir%. 42 | Expand,%SrcDir%\ex1.cab,%DestDir% 43 | ``` 44 | 45 | ```pebakery 46 | // EXPLORER.EXE will be extracted from EXPLORER.EX_ 47 | Expand,%Source_Win%\EXPLORER.EX_,%Target_Win% 48 | ``` 49 | 50 | ```pebakery 51 | // Extract only BatteryLine.exe from multi.cab, overwrite with warning if file exists. 52 | Expand,%SrcDir%\multi.cab,%DestDir%,BatteryLine.exe 53 | ``` 54 | 55 | ```pebakery 56 | // Extract only BatteryLine.exe from multi.cab, do not overwrite if file exists. 57 | Expand,%SrcDir%\multi.cab,%DestDir%,BatteryLine.exe,PRESERVE 58 | ``` 59 | -------------------------------------------------------------------------------- /Commands/Archive/README.md: -------------------------------------------------------------------------------- 1 | # Archive Commands 2 | 3 | PEBakery has the ability to extract and compress files to and from various archive formats. 4 | 5 | Click on a Command name for a detailed description. 6 | 7 | | Command | Description | 8 | | --- | --- | 9 | | [Compress](./Compress.md) | Compress a file or directory into an archive. | 10 | | [CopyOrExpand](./CopyOrExpand.md) | Copy or Extract files from a Microsoft Cabinet Archive (*.CAB). | 11 | | [Decompress](./Decompress.md) | Extract files from an archive. | 12 | | [Expand](./Expand.md) | Extract files from a Microsoft Cabinet Archive (*.CAB). | 13 | -------------------------------------------------------------------------------- /Commands/Branch/Break.md: -------------------------------------------------------------------------------- 1 | # Break 2 | 3 | Terminate execution of a While/ForEach/ForRange loop. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Break 9 | ``` 10 | 11 | ### Arguments 12 | 13 | None. 14 | 15 | ## Remarks 16 | 17 | Breaking out of a loop will continue execution of the script with the next line following the end of the While/ForEach/ForRange statement. 18 | 19 | ## Related 20 | 21 | [Continue](./Continue.md), [ForEach](./ForEach.md), [ForRange](./ForRange.md), [While](./While.md) 22 | 23 | ## Examples 24 | 25 | ### Example 1 26 | 27 | Break out of an infinite loop with a certain condition occurs. 28 | 29 | ```pebakery 30 | [Main] 31 | Title=Simple Break Example 32 | Description=Demonstrate how to Break out of a loop. 33 | Level=5 34 | Version=1 35 | Author=Homes32 36 | 37 | [Variables] 38 | 39 | [Process] 40 | 41 | Set,%i%,0 42 | 43 | ; Infinite loop 44 | While,1,Equal,1,Begin 45 | Message,"i = %i%" 46 | If,%i%,Equal,5,Break 47 | Math,Add,%i%,%i%,1 48 | End 49 | ``` 50 | -------------------------------------------------------------------------------- /Commands/Branch/Continue.md: -------------------------------------------------------------------------------- 1 | # Continue 2 | 3 | Continue execution of a While/ForEach/ForRange loop. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Continue 9 | ``` 10 | 11 | ### Arguments 12 | 13 | None. 14 | 15 | ## Remarks 16 | 17 | Continue will continue execution of the loop from the original While/ForEach/ForRange statement. 18 | 19 | ContinueLoop can be rewritten using If-ElseIf-EndIf statements, however using ContinueLoop can make long scripts easier to understand. 20 | 21 | Be careful using Continue with While loops; you can create infinite loops by using Continue incorrectly. 22 | 23 | ## Related 24 | 25 | [Break](./Break.md), [ForEach](./ForEach.md), [ForRange](./ForRange.md), [While](./While.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | Count upward from 1 to 10 but skip displaying 5. 32 | 33 | ```pebakery 34 | [Main] 35 | Title=Simple Continue Example 36 | Description=Demonstrate how to Continue a loop. 37 | Level=5 38 | Version=1 39 | Author=Homes32 40 | 41 | [Variables] 42 | 43 | [Process] 44 | ForRange,%i%,1,11,1,Begin 45 | If,%i%,Equal,5,Continue 46 | Message,"#$pi#$p: %i%" 47 | End 48 | ``` 49 | -------------------------------------------------------------------------------- /Commands/Branch/If.md: -------------------------------------------------------------------------------- 1 | # If 2 | 3 | Conditionally run a statement. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | If,, 9 | ``` 10 | 11 | ```pebakery 12 | If,,Begin 13 | 14 | ... 15 | 16 | End 17 | ``` 18 | 19 | ### Arguments 20 | 21 | | Argument | Description | 22 | | --- | --- | 23 | | Condition | Condition to evaluate as `True` or `False`. | 24 | | Command | The command to be executed if the condition is `True`. | 25 | 26 | ## Remarks 27 | 28 | `If` statements and blocks can be nested. 29 | 30 | ## Related 31 | 32 | [If-Else](./If-Else.md), [If-Question](./If-Question.md), [Operators](./Operators.md) 33 | 34 | ## Examples 35 | 36 | ### Example 1 37 | 38 | ```pebakery 39 | [main] 40 | Title=If Example 41 | Description=Demonstrate how to run conditional statements using If. 42 | Level=5 43 | Version=1 44 | Author=Homes32 45 | 46 | [variables] 47 | 48 | [process] 49 | // Single If statement. Will create a text file if it doesn't already exist. 50 | If,Not,ExistFile,C:\Temp\myFile.txt,FileCreateBlank,C:\Temp\myFile.txt 51 | 52 | // If statement using a command block to run multiple commands if the statement evaluates to True. 53 | If,ExistFile,C:\Temp\myFile.txt,Begin 54 | TXTAddLine,C:\Temp\myFile.txt,"Hello World!",APPEND 55 | ShellExecute,Open,C:\Temp\myFile.txt 56 | End 57 | ``` -------------------------------------------------------------------------------- /Commands/Branch/README.md: -------------------------------------------------------------------------------- 1 | # Branch Commands 2 | 3 | Branch commands such as conditional statements, comparison operators, and loops allow you to control the flow of your script and execute code located in other scripts or sections based on the result of the expression. 4 | 5 | Click on a Command name for a detailed description. 6 | 7 | | Command | Description | 8 | | --- | --- | 9 | | [Break](./Break.md) | Terminate execution of a While/ForEach/ForRange loop. | 10 | | [Continue](./Continue.md) | Continue execution of a While/ForEach/ForRange loop. | 11 | | [Exec](./Exec.md) | Runs the commands found in a named `[Section]` of a script file. | 12 | | [ForEach](./ForEach.md) | Enumerates the elements of a list and executes its body for each element in the list. | 13 | | [ForRange](./ForRange.md) | Loops through a series of commands based on the value of a counter. | 14 | | [If](./If.md) | Conditionally run a statement. | 15 | | [If-Else](./If-Else.md) | Conditionally run statements. | 16 | | [If-Question](./If-Question.md) | Displays a dialog that asks the user a question, then uses their response to determine if the command should be executed. | 17 | | [Loop](./Loop.md) | Loops through a series of commands based on the value of a counter. | 18 | | [LoopLetter](./LoopLetter.md) | Loops through a range of letters in alphabetical order. | 19 | | [Operators](./Operators.md) | Supported comparison and logical operators. | 20 | | [Run](./Run.md) | Runs the commands found in a named `[Section]` of a script file. | 21 | | [RunEx](./RunEx.md) | Runs the commands found in a named `[Section]` of a script file. Supports passing parameters by reference. | 22 | | [While](./While.md) | Loops through a series of commands based on an expression. | -------------------------------------------------------------------------------- /Commands/Branch/While.md: -------------------------------------------------------------------------------- 1 | # While 2 | 3 | Loops through a series of commands based on an expression. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | While,, 9 | ``` 10 | 11 | ```pebakery 12 | While,,Begin 13 | 14 | ... 15 | 16 | End 17 | ``` 18 | 19 | ### Arguments 20 | 21 | | Argument | Description | 22 | | --- | --- | 23 | | Expression | If the expression evaluates to true the following commands up to the `End` statement are executed. This loop continues until the expression evaluates to false. | 24 | | Command | The command to be executed, or the `Begin` statement indicating a block of commands. | 25 | 26 | ## Remarks 27 | 28 | While statements may be nested. 29 | 30 | At any point within the body of an `While` statement, you can break out of the loop by using the `Break` statement, or step to the next iteration in the loop by using the `Continue` statement. 31 | 32 | The expression is tested before the loop is executed so the loop will be executed zero or more times. 33 | 34 | To create an infinite loop, you can use a fixed condition as the expression. (eg. `While,1,Equal,1`) 35 | 36 | ## Related 37 | 38 | [Break](./Break.md), [Continue](./Continue.md) 39 | 40 | ## Examples 41 | 42 | ### Example 1 43 | 44 | A simple loop that counts to 10 and displays a message box showing the current loop count. 45 | 46 | ```pebakery 47 | [main] 48 | Title=Simple While Example 49 | Description=Demonstrate how to perform a simple While loop. 50 | Level=5 51 | Version=1 52 | Author=Homes32 53 | 54 | [variables] 55 | 56 | [process] 57 | Set,%i%,0 58 | While,%i%,<=,10,Begin 59 | Message,"Value of i is: %i%" 60 | Math,Add,%i%,%i%,1 61 | End 62 | ``` 63 | -------------------------------------------------------------------------------- /Commands/Control/AddVariables.md: -------------------------------------------------------------------------------- 1 | # AddVariables 2 | 3 | Reads variables from another section, script, or file into the current scripts run-time environment. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | AddVariables,,
,[GLOBAL] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file to read. **Hint:** Use `%ScriptFile%` to reference the current script.| 16 | | Section | The section containing the variables to be added. | 17 | 18 | ### Flags 19 | 20 | | Flag | Description | 21 | | --- | --- | 22 | | GLOBAL | **(Optional)** The variables are added to the global scope and available to the entire project for the duration of the build. If the variables exist they will be overwritten! | 23 | 24 | ## Remarks 25 | 26 | When a script runs, it automatically adds variables defined in the `[Variables]` section of the script. The `AddVariables` command gives you the flexibility to add additional variables stored in other scripts and files and can be used in *script.project* to load variables and macros for the entire project. 27 | 28 | ## Related 29 | [Set](./Set.md), [SetMacro](./SetMacro.md) 30 | 31 | ## Examples 32 | 33 | ### Example 1 34 | 35 | ```pebakery 36 | // Add variables from another section in the current script 37 | AddVariables,%ScriptFile%,AlternativeVariables 38 | ``` 39 | 40 | ### Example 2 41 | 42 | The following code if placed in *script.project* will load macros defined in a script "library" for use by the entire project. 43 | 44 | ```pebakery 45 | // Add macros from another script so they are available to all scripts 46 | AddVariables,%BaseDir%\Build\Library.script,ApiVar,GLOBAL 47 | ``` 48 | -------------------------------------------------------------------------------- /Commands/Control/Beep.md: -------------------------------------------------------------------------------- 1 | # Beep 2 | 3 | Provide auditory feedback to the user. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Beep, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Type | Select from the following sounds: | 16 | || Ok | 17 | || Error | 18 | || Asterisk | 19 | || Confirmation | 20 | 21 | ## Remarks 22 | 23 | The exact sound that is played with each `Type` is defined by the operating system's sound scheme. 24 | 25 | ## Related 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | Beep,Error 33 | ``` -------------------------------------------------------------------------------- /Commands/Control/Exit.md: -------------------------------------------------------------------------------- 1 | # Exit 2 | 3 | Forces the current script to terminate and continues processing with the next script. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Exit,[,NOWARN] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Message | Text that will be displayed and written to the log citing the reason for the `Exit`. | 16 | 17 | ### Flags 18 | 19 | | Flag | Description | 20 | | --- | --- | 21 | | NOWARN | **(Optional)** Suppresses the Warning state in the log. | 22 | 23 | ## Remarks 24 | 25 | Default behavior is to log the `Exit` action as a warning. If this is not a critical event you can override this behavior with the `NOWARN` flag. 26 | 27 | If the script has defined the `System,OnScriptExit` directive the command will be processed before the script exits. This allows the developer to perform further logging and cleanup based on the reason for the `Exit`. 28 | 29 | ## Related 30 | 31 | [System,OnScriptExit](../System/OnScriptExit.md) 32 | 33 | ## Examples 34 | 35 | ### Example 1 36 | 37 | Stop processing the current script and log a warning. 38 | 39 | ```pebakery 40 | Exit,"Unable to continue because the file was not found." 41 | ``` 42 | 43 | ### Example 2 44 | 45 | Stop processing the current script, but don't log a warning. 46 | 47 | ```pebakery 48 | // No need to warn the user as the action is intended to prevent further processing. 49 | Exit,"The application is already configured.",NOWARN 50 | ``` -------------------------------------------------------------------------------- /Commands/Control/GetParam.md: -------------------------------------------------------------------------------- 1 | # GetParam 2 | 3 | Retrieves parameters passed to a section and converts them into variables. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | GetParam,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Index | The 1-based index of the parameter to retrieve. | 16 | | DestVar | The name of variable where the value will be saved. | 17 | 18 | ## Remarks 19 | 20 | As a result of PEBakery's backwards compatible Winbuilder syntax, parameters passed to a section can only be referenced by tokens consisting of a hash mark `#` followed by a single digit representing the 1-base index of the parameter (ex. #1). The `GetParam` command must be used to retrieve the value of any parameter index greater then 9. 21 | 22 | ## Related 23 | 24 | [Sections](../../LangRef/Sections.md) 25 | 26 | ## Examples 27 | 28 | Using `GetParam` to retrieve the value of the 12th parameter passed to a section. 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=GetParam Example 1 35 | Description=Show usage of the GetParam command. 36 | Author=Homes32 37 | Level=5 38 | Version=1 39 | 40 | [Variables] 41 | 42 | [Process] 43 | Run,%ScriptFile%,doSomething,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve 44 | 45 | [doSomething] 46 | GetParam,12,%myParam% 47 | Message,"Parameter 12: %myParam%" 48 | 49 | [Interface] 50 | pFileBox1=C:\Images\,1,13,23,44,230,20,dir 51 | pTextLabel1="Select your source directory:",1,1,23,25,230,18,8,Bold 52 | ``` 53 | 54 | ### Example 2 55 | 56 | Using GetParam can also be an easy way to make your code more readable, since it allows you to assign a meaningful variable name to the parameters, especially when you have many of them. 57 | 58 | ``` 59 | GetParam,5,%SomeValue% 60 | If,%SomeValue%,Equal,True,Run,%ScriptFile%,DoSomething 61 | ```` 62 | 63 | is more easily understood then 64 | 65 | `If,#5,Equal,True,Run,%ScriptFile%,DoSomething` -------------------------------------------------------------------------------- /Commands/Control/Halt.md: -------------------------------------------------------------------------------- 1 | # Halt 2 | 3 | Forces the current build to terminate. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Halt, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Message | Text that will be displayed and written to the log citing the reason for the `Halt`. | 16 | 17 | ## Remarks 18 | 19 | If the project has defined the `System,OnBuildExit` directive the command will be processed before the build halts. This allows the developer to clean up any temporary files and/or mount points, and unload any registry hives. 20 | 21 | ## Related 22 | 23 | [System,OnBuildExit](../System/OnBuildExit.md) 24 | 25 | ## Examples 26 | 27 | ### Example 1 28 | 29 | Abort the current build. 30 | 31 | ```pebakery 32 | Halt,"Incompatible Source. Please select a valid source and try building again." 33 | ``` -------------------------------------------------------------------------------- /Commands/Control/README.md: -------------------------------------------------------------------------------- 1 | # Control Commands 2 | 3 | Click on a Command name for a detailed description. 4 | 5 | | Command | Description | 6 | | --- | --- | 7 | | [AddVariables](./AddVariables.md) | Reads variables from another section, script, or file into the current scripts run-time environment. | 8 | | [Beep](./Beep.md) | Provide auditory feedback to the user. | 9 | | [Exit](./Exit.md) | Forces the current script to terminate and continues processing with the next script. | 10 | | [GetParam](./GetParam.md) | Retrieve parameters passed to a section and convert them into variables. | 11 | | [Halt](./Halt.md) | Forces the current build to terminate. | 12 | | [Set](./Set.md) | Changes or Defines the value of a variable. | 13 | | [SetMacro](./SetMacro.md) | Defines a procedure to be executed when a specific keyword is encountered. | 14 | | [Wait](./Wait.md) | Pause the script execution for a specific amount of time. | -------------------------------------------------------------------------------- /Commands/Control/Return.md: -------------------------------------------------------------------------------- 1 | # Return 2 | 3 | Stop running a section immediately and return to the calling script/section. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Return,[VALUE] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Return Value | **(Optional)** Will set value of the `#r` token, which will be made available to the caller upon return. | 16 | 17 | ## Remarks 18 | 19 | Calling `Return` directly from the `[Process]` section of the calling script has the same effect as the `Exit,NOWARN` command, and will abort the running script. 20 | 21 | ## Related 22 | 23 | [Run](../Branch/Run.md) 24 | 25 | ## Examples 26 | 27 | ### Example 1 28 | 29 | Stop processing the current section and return. 30 | 31 | ```pebakery 32 | Set,%var%,2 33 | If,Not,%var%,Equal,1,Return 34 | Echo,"We should never get here..." 35 | ``` 36 | 37 | ### Example 2 38 | 39 | Stop processing the current section and return, setting the value of `#r` to `%var%`. 40 | 41 | ```pebakery 42 | Set,%var%,2 43 | If,Not,%var%,Equal,1,Return,%var% 44 | Echo,"We should never get here..." 45 | ``` -------------------------------------------------------------------------------- /Commands/Control/Wait.md: -------------------------------------------------------------------------------- 1 | # Wait 2 | 3 | Pause execution for a specific amount of time. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Wait, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Seconds | Number of seconds to pause before processing continues. | 16 | 17 | ## Remarks 18 | 19 | The `Wait` command can be used to give other programs time to start or finish execution before another operation takes place. Another common use is to pause processing for a few seconds to allow the user to react to an event, such as as an `Echo` message. 20 | 21 | ## Related 22 | 23 | ## Examples 24 | 25 | ### Example 1 26 | 27 | ```pebakery 28 | // Wait 5 seconds then continue. 29 | Echo,"Waiting 5 seconds..." 30 | Wait,5 31 | ``` -------------------------------------------------------------------------------- /Commands/File/DirDelete.md: -------------------------------------------------------------------------------- 1 | # DirDelete 2 | 3 | Deletes a directory and all files and sub-directories it contains. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | DirDelete, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DirPath | Full path of the directory to delete. | 16 | 17 | ## Remarks 18 | 19 | If `DirPath` does not exist the build will halt. 20 | 21 | **Deleted folders are permanently removed can not be recovered from the recycle bin.** 22 | 23 | ## Related 24 | 25 | [FileDelete](./FileDelete.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | // C:\Temp will be deleted. 33 | DirDelete,C:\Temp 34 | ``` -------------------------------------------------------------------------------- /Commands/File/DirMake.md: -------------------------------------------------------------------------------- 1 | # DirMake 2 | 3 | Creates a directory. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | DirMake, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestDir | Full path of the directory to create. | 16 | 17 | ## Remarks 18 | 19 | None. 20 | 21 | ## Related 22 | 23 | [DirCopy](./DirCopy.md), [DirDelete](./DirDelete.md), [DirMove](./DirMove.md) 24 | 25 | ## Examples 26 | 27 | ### Example 1 28 | 29 | ```pebakery 30 | // C:\Temp will be created. 31 | DirMake,C:\Temp 32 | ``` 33 | -------------------------------------------------------------------------------- /Commands/File/DirMove.md: -------------------------------------------------------------------------------- 1 | # DirMove 2 | 3 | Moves a directory. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | DirMove,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | SrcDir | Full path of the directory to move. | 16 | | DestPath | Full path of the destination directory. The directory structure will be created if it does not exist. Any existing files will be overwritten. | 17 | 18 | ## Remarks 19 | 20 | WinBuilder 082 allows DirMove to move files. Turning on the compatibility option `FileRename and DirMove work like PathMove` makes the `DirMove` command identical to `PathMove`. 21 | 22 | ## Related 23 | 24 | [DirCopy](./DirCopy.md), [DirDelete](./DirDelete.md), [PathMove](./PathMove.md) 25 | 26 | ## Examples 27 | 28 | ### Example 1 29 | 30 | ```pebakery 31 | DirMove,%SrcDir%\A,%DestDir% 32 | ``` 33 | -------------------------------------------------------------------------------- /Commands/File/DirSize.md: -------------------------------------------------------------------------------- 1 | # DirSize 2 | 3 | **Alias**: `Retrieve,DirSize` 4 | 5 | Gets the size of a directory. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | DirSize,,<%DestVar%> 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | DirPath | Full path of the directory. | 18 | | DestVar | Variable where the directory size (in bytes) will be stored. | 19 | 20 | ## Remarks 21 | 22 | If `DirPath` contains files that cannot be accessed with `Administrator` privileges PEBakery ignores them. 23 | 24 | You can use `StrFormat,Bytes` to convert the size to a more human readable format. (Ex. 3.5GB) 25 | 26 | ## Related 27 | 28 | [FileSize](./FileSize.md), [StrFormat,BytesToInt](../String/BytesToInt.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | ```pebakery 35 | [Main] 36 | Title=DirSize 37 | Description=Show the usage of DirSize. 38 | Level=5 39 | Version=1 40 | Author=Homes32 41 | 42 | [Variables] 43 | %Dir%=C:\Windows\System32 44 | 45 | [process] 46 | DirSize,%Dir%,%Size% 47 | // Use StrFormat to convert the size to a more human readable format. 48 | StrFormat,Bytes,%Size%,%StrSize% 49 | Message,"Dir Size: %Size% bytes (%StrSize%)" 50 | ``` 51 | -------------------------------------------------------------------------------- /Commands/File/FileCreateBlank.md: -------------------------------------------------------------------------------- 1 | # FileCreateBlank 2 | 3 | Creates an empty file. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | FileCreateBlank,,[Encoding=],[PRESERVE],[NOWARN] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FilePath | Path to create empty file. The directory structure will be created if it does not exist. | 16 | | Encoding= | **(Optional)** Character encoding to use in the new file. Supported encodings are : | 17 | || If no encoding is specified the file is encoded as UTF8 without BOM | 18 | || `ANSI` - ANSI | 19 | || `UTF8` - UTF-8 **(Default)** | 20 | || `UTF8BOM` - UTF-8 BOM | 21 | || `UTF16`, `UTF16LE` - UTF-16 Little Endian | 22 | || `UTF16BE` - UTF-16 Big Endian | 23 | 24 | ### Flags 25 | 26 | Flags may be specified in any order. 27 | 28 | | Flag | Description | 29 | | --- | --- | 30 | | PRESERVE | **(Optional)** Do not overwrite existing files. | 31 | | NOWARN | **(Optional)** Do not log a warning if file is overwritten. | 32 | 33 | ## Remarks 34 | 35 | Some commands such as `TXTAddLine` require that the file exists before it can be written. This command can be to create an empty text file if the target file does not exist. 36 | 37 | For batch files (*.bat, *.cmd), use `ANSI` encoding. For normal text files, `UTF8` or `UTF16` encoding is highly recommended. 38 | 39 | ## Related 40 | 41 | [TXTAddLine](../Text/TXTAddLine.md) 42 | 43 | ## Examples 44 | 45 | ### Example 1 46 | 47 | Create empty file Unicode.txt, write BOM (U+FEFF) encoded with UTF-16 Little Endian. 48 | 49 | ```pebakery 50 | FileCreateBlank,C:\Temp\Unicode.txt,UTF16 51 | ``` 52 | 53 | ### Example 2 54 | 55 | This sample script checks to see if the target file exists, and uses `FileCreateBlank` to create it if necessary. 56 | 57 | ```pebakery 58 | [Main] 59 | Title=FileCreateBlank 60 | Description=Show the usage of FileCreateBlank. 61 | Level=5 62 | Version=1 63 | Author=Homes32 64 | 65 | [Variables] 66 | %grubMenu%=C:\Temp\menu.lst 67 | 68 | [process] 69 | If,Not,ExistFile,%grubMenu%,FileCreateBlank,%grubMenu% 70 | TXTAddLine,%grubMenu%,"TITLE Main Menu",APPEND 71 | ``` -------------------------------------------------------------------------------- /Commands/File/FileRename.md: -------------------------------------------------------------------------------- 1 | # FileRename 2 | 3 | **Alias**: `FileMove` 4 | 5 | Rename or move a file. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | FileRename,, 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | SrcPath | Full path of the file to rename. | 18 | | DestPath | New path of the renamed file. | 19 | 20 | ## Remarks 21 | 22 | `FileRename` can also be used to move a file. 23 | 24 | WinBuilder 082 allows `FileRename` to move a directory. Turning on compatibility option `FileRename and DirMove work like PathMove` makes `FileRename` identical to `PathMove`. 25 | 26 | ## Related 27 | 28 | [FileCopy](./FileCopy.md), [PathMove](./PathMove.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | `A.txt` will be renamed to `B.txt`. 35 | 36 | ```pebakery 37 | FileRename,%SrcDir%\A.txt,%SrcDir%\B.txt 38 | ``` 39 | 40 | ### Example 2 41 | 42 | `%SrcDir%\A.txt` will be moved into `%DestDir%\B.txt`. 43 | 44 | ```pebakery 45 | FileMove,%SrcDir%\A.txt,%DestDir%\B.txt 46 | ``` 47 | -------------------------------------------------------------------------------- /Commands/File/FileSize.md: -------------------------------------------------------------------------------- 1 | # FileSize 2 | 3 | **Alias**: `Retrieve,FileSize` 4 | 5 | Gets the size of a file. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | FileSize,, 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | FilePath | Full path of the file. | 18 | | DestVar | Variable where the file size (in bytes) will be stored. | 19 | 20 | ## Remarks 21 | 22 | You can use `StrFormat,BytesToInt` to convert the size to a more human readable format. (Ex. 3.5MB) 23 | 24 | ## Related 25 | 26 | [DirSize](./DirSize.md), [StrFormat,BytesToInt](../String/BytesToInt.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=FileSize 35 | Description=Show the usage of FileSize. 36 | Level=5 37 | Version=1 38 | Author=Homes32 39 | 40 | [Variables] 41 | %File%=C:\Windows\notepad.exe 42 | 43 | [process] 44 | FileSize,%File%,%Size% 45 | // Use StrFormat to convert the size to a more human readable format. 46 | StrFormat,Bytes,%Size%,%StrSize% 47 | Message,"File Size: %Size% bytes (%StrSize%)" 48 | ``` 49 | -------------------------------------------------------------------------------- /Commands/File/FileVersion.md: -------------------------------------------------------------------------------- 1 | # FileVersion 2 | 3 | **Alias**: `Retrieve,FileVersion` 4 | 5 | Retrieves the version number of the specified file. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | FileVersion,,<%DestVar%> 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | FilePath | Full path of the file. | 18 | | DestVar | Variable where the file version will be stored. | 19 | 20 | ## Remarks 21 | 22 | If version information is not available the command returns `0.0.0.0` 23 | 24 | ## Related 25 | 26 | ## Example 27 | 28 | ```pebakery 29 | [Main] 30 | Title=FileVersion 31 | Description=Show the usage of FileVersion. 32 | Level=5 33 | Version=1 34 | Author=Homes32 35 | 36 | [Variables] 37 | %File%=C:\Windows\notepad.exe 38 | 39 | [process] 40 | FileVersion,%File%,%Ver% 41 | Message,"%File%#$xFile Version: %Ver%" 42 | ``` -------------------------------------------------------------------------------- /Commands/File/PathMove.md: -------------------------------------------------------------------------------- 1 | # PathMove 2 | 3 | Moves a file or directory. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | PathMove,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | SrcPath | Full path of the file or directory to move. | 16 | | DestPath | Destination Path. | 17 | 18 | ## Remarks 19 | 20 | Turning on compatibility option `FileRename and DirMove work like PathMove` makes FileRename and DirMove identical to PathMove. 21 | 22 | ## Related 23 | 24 | [DirMove](./DirMove.md), [FileRename](./FileRename.md) 25 | 26 | ## Examples 27 | 28 | ### Example 1 29 | 30 | `A.txt` will be renamed to `B.txt`. 31 | 32 | ```pebakery 33 | PathMove,%SrcDir%\A.txt,%SrcDir%\B.txt 34 | ``` 35 | 36 | ### Example 2 37 | 38 | `%SrcDir%\A.txt` will be moved into `%DestDir%\B.txt`. 39 | 40 | ```pebakery 41 | PathMove,%SrcDir%\A.txt,%DestDir%\B.txt 42 | ``` 43 | 44 | ### Example 3 45 | 46 | If %DestDir% exists: `%SrcDir%\A` will be moved into `%DestDir%\A`. 47 | If %DestDir% does not exist: `%SrcDir%\A` will be moved into `%DestDir%`. 48 | 49 | ```pebakery 50 | PathMove,%SrcDir%\A,%DestDir% 51 | ``` 52 | -------------------------------------------------------------------------------- /Commands/File/README.md: -------------------------------------------------------------------------------- 1 | # File & Directory Commands 2 | 3 | Click on a Command name for a detailed description. 4 | 5 | | Command | Description | 6 | | --- | --- | 7 | | [DirCopy](./DirCopy.md) | Copies a directory along with all sub-directories and files. | 8 | | [DirDelete](./DirDelete.md) | Deletes a directory and all files and sub-directories it contains. | 9 | | [DirMake](./DirMake.md) | Creates a directory. | 10 | | [DirMove](./DirMove.md) | Moves a directory. | 11 | | [DirSize](./DirSize.md) | Gets the size of a directory. | 12 | | [FileCopy](./FileCopy.md) | Copies one or more files. | 13 | | [FileCreateBlank](./FileCreateBlank.md) | Creates an empty file. | 14 | | [FileDelete](./FileDelete.md) | Deletes a file. | 15 | | [FileRename](./FileRename.md) | Rename or move a file. | 16 | | [FileSize](./FileSize.md) | Gets the size of a file. | 17 | | [FileVersion](./FileVersion.md) | Retrieves the version number of the specified file. | 18 | | [PathMove](./PathMove.md) | Moves a file or directory. | -------------------------------------------------------------------------------- /Commands/Hash/Hash.md: -------------------------------------------------------------------------------- 1 | # Hash 2 | 3 | Calculates the cryptographic hash of a file. 4 | 5 | The result can then be compared with a known value in order to verify the integrity of a file. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | Hash,,,<%DestVar%> 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | HashType | Hash type to calculate. Supported algorithms are: `MD5`, `SHA1`, `SHA256`, `SHA384`, `SHA512`. 18 | | FilePath | The full path of file to hash. | 19 | | DestVar | The variable where the hash digest will be saved. | 20 | 21 | ## Remarks 22 | 23 | The `WebGet` command has hash verification of downloaded files builtin. 24 | 25 | ## Related 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | The following example uses the `Hash` function to verify that *notepad.exe* is not corrupt. 32 | 33 | ```pebakery 34 | [Main] 35 | Title=Hash Example 36 | Description=Show usage of the Hash Command 37 | Author=Homes32 38 | Level=5 39 | Version=1 40 | 41 | [Variables] 42 | %notepadHash%=233a35e4b579ccde25951f8e543f1d16ae3e7b5b3f29c1d56e691ffb075ced15 43 | 44 | [Process] 45 | Hash,SHA256,%WindowsDir%\System32\notepad.exe,%Hash% 46 | If,%Hash%,Equal,%notepadHash%,Message,"Notepad.exe verified!#$x#$xHash: %Hash%" 47 | Else,Message,"Notepad.exe verification failed!#$x#$xHash: %Hash%#$x#$xdoes not match#$x#$x%notepadHash%" 48 | ``` -------------------------------------------------------------------------------- /Commands/Hash/README.md: -------------------------------------------------------------------------------- 1 | # Hash Commands 2 | 3 | Click on a Command name for a detailed description. 4 | 5 | | Command | Description | 6 | | --- | --- | 7 | | [Hash](./Hash.md) | Calculates the cryptographic hash of a file. | -------------------------------------------------------------------------------- /Commands/INI/IniAddSection.md: -------------------------------------------------------------------------------- 1 | # IniAddSection 2 | 3 | Adds a new empty section inside a standard .ini file. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | IniAddSection,,
9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file. | 16 | | Section | The name of the Section to be added. | 17 | 18 | ## Remarks 19 | 20 | If the section already exists no action will be taken. 21 | 22 | PEBakery will optimize multiple `IniAddSection` commands in a row into a single write command. 23 | 24 | ## Example 25 | 26 | In the following example the section `mySection` will be created inside C:\myFile.ini. 27 | 28 | ```pebakery 29 | IniAddSection,C:\myFile.ini,mySection 30 | ``` 31 | -------------------------------------------------------------------------------- /Commands/INI/IniCompact.md: -------------------------------------------------------------------------------- 1 | # IniCompact 2 | 3 | Compacts an .ini file, removing extra white space such as leading/trailing spaces and padding between key=value pairs. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | IniCompact, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file. | 16 | 17 | ## Remarks 18 | 19 | If `FileName` does not exist the operation will fail. 20 | 21 | ## Example 1 22 | 23 | Lets assume we have the following .ini file: 24 | 25 | ```pebakery 26 | ; C:\myFile.ini 27 | [mySection] 28 | myKey=myValue 29 | anotherKey = anotherValue 30 | cow= moo 31 | ``` 32 | 33 | Compact the file C:\myFile.ini 34 | 35 | ```pebakery 36 | IniCompact,C:\myFile.ini 37 | ``` 38 | 39 | Result: 40 | 41 | ```pebakery 42 | ; C:\myFile.ini 43 | [mySection] 44 | myKey=myValue 45 | anotherKey=anotherValue 46 | cow=moo 47 | ``` -------------------------------------------------------------------------------- /Commands/INI/IniDelete.md: -------------------------------------------------------------------------------- 1 | # IniDelete 2 | 3 | Deletes a key from a standard .ini file. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | IniDelete,,
, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file. | 16 | | Section | The Section containing the value to be removed. | 17 | | Key | The value to be removed.| 18 | 19 | ## Remarks 20 | 21 | PEBakery will optimize multiple `IniDelete` commands in a row into single delete command. 22 | 23 | ## Example 24 | 25 | Lets assume we have the following .ini file: 26 | 27 | ```pebakery 28 | // C:\myFile.ini 29 | [mySection] 30 | myKey=myValue 31 | anotherKey=anotherValue 32 | ``` 33 | 34 | In the following example the key `myKey` and it's value will be removed. 35 | 36 | ```pebakery 37 | IniDelete,C:\myFile.ini,mySection,myKey 38 | ``` -------------------------------------------------------------------------------- /Commands/INI/IniDeleteSection.md: -------------------------------------------------------------------------------- 1 | # IniDeleteSection 2 | 3 | Deletes a section, along with all keys and values it contains from a standard .ini file. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | IniDeleteSection,,
9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file. | 16 | | Section | The Section to be removed. | 17 | 18 | ## Remarks 19 | 20 | PEBakery will optimize multiple `IniDeleteSection` commands in a row into a single delete command. 21 | 22 | ## Example 23 | 24 | In the following example the section `mySection` will be removed along with any keys and values it contains. 25 | 26 | ```pebakery 27 | IniDeleteSection,C:\myFile.ini,mySection 28 | ``` 29 | -------------------------------------------------------------------------------- /Commands/INI/IniRead.md: -------------------------------------------------------------------------------- 1 | # IniRead 2 | 3 | Reads a value from a standard .ini file. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | IniRead,,
,,<%DestVar%>[,Default=] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file to read. | 16 | | Section | The section containing the value to be read. | 17 | | Key | The value to be read. | 18 | | DestVar | The value will be saved to this variable. | 19 | | Default= | **(Optional)** The value to be used if the Key cannot be found. If this parameter is NULL or undefined, the default is an empty string, "". | 20 | 21 | ## Remarks 22 | 23 | PEBakery will optimize multiple `IniRead` commands in a row into a single read command. 24 | 25 | ## Example 26 | 27 | Let's assume we have the following .ini file: 28 | 29 | ```pebakery 30 | // C:\myFile.ini 31 | [mySection] 32 | myKey=myValue 33 | anotherKey=anotherValue 34 | ``` 35 | 36 | ### Example 1 37 | In the following example the value of the key `myKey` will be stored inside `%myVariable%`. 38 | 39 | ```pebakery 40 | IniRead,C:\myFile.ini,mySection,myKey,%myVariable% 41 | ``` 42 | 43 | ### Example 2 44 | In the following example the value of the key `myKey2` does not exist so the default value of `Hello` will be stored inside `%myVariable%`. 45 | 46 | ```pebakery 47 | IniRead,C:\myFile.ini,mySection,myKey,%myVariable%,Default=Hello 48 | ``` -------------------------------------------------------------------------------- /Commands/INI/IniReadSection.md: -------------------------------------------------------------------------------- 1 | # IniReadSection 2 | 3 | Reads the contents of a section in a standard .ini file and outputs the result as a list. 4 | 5 | The string returned is a 1-dimensional list with the `Keys` in the Odd position and the `Values` in the even position. You can then use any of the `List` or `StrFormat` commands to interact with the data. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | IniReadSection,,
,<%DestVar%>[,Delim=] 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | FileName | The full path of the file to read. | 18 | | Section | The section to be read. | 19 | | DestVar | The value will be saved to this variable. | 20 | | Delim= | **(Optional)** Delimiter used to separate the `Items` in the list. **Default:** `\|` | 21 | 22 | ## Remarks 23 | 24 | Note: Special characters such as comma's `,` must be escaped `#$c` when specifying the `Delim=` argument. 25 | 26 | PEBakery will optimize multiple `IniReadSection` commands in a row to single read command. 27 | 28 | ## Example 29 | 30 | Let's assume a file `%SrcFile%` contains these lines: 31 | 32 | ```pebakery 33 | [English] 34 | 1=One 35 | 2=Two 36 | 3=Three 37 | 38 | [Korean] 39 | 1=하나 40 | 2=둘 41 | ``` 42 | 43 | ### Example 1 44 | 45 | In the following example the contents of the section `English` will be stored inside `%Dest%`. 46 | 47 | ```pebakery 48 | IniReadSection,%SrcFile%,English,%Dest% 49 | ``` 50 | 51 | Returns: 52 | 53 | ```pebakery 54 | 1|One|2|Two|3|Three 55 | ``` 56 | 57 | This translates logically into: 58 | 59 | | | | | | | | | 60 | | --- | :---: | :---: | :---: | :---: | :---: | :---: | 61 | | **Index** | 1 | 2 | 3 | 4 | 5 | 6 | 62 | | **Value** | 1 | One | 2 | Two | 3 | Three | 63 | 64 | 65 | ### Example 2 66 | 67 | IniReadSection will return the section `Korean` into `%Dest%`. 68 | 69 | ```pebakery 70 | IniReadSection,%SrcFile%,Korean,%Dest%,Delim=#$c 71 | ``` 72 | 73 | Returns: 74 | 75 | ```pebakery 76 | 1,하나,2,둘 77 | ``` -------------------------------------------------------------------------------- /Commands/INI/IniWrite.md: -------------------------------------------------------------------------------- 1 | # IniWrite 2 | 3 | Writes a value to a standard .ini file. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | IniWrite,,
,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file. | 16 | | Section | The Section where the value will be written. | 17 | | Key | The key that will contain the value.| 18 | | Value | The value to write.| 19 | 20 | ## Remarks 21 | 22 | If `FileName` does not exist it will be created using UTF-8 encoding. 23 | 24 | PEBakery will optimize multiple `IniWrite` commands in a row into a single write command. 25 | 26 | ## Example 1 27 | 28 | Lets assume we have the following .ini file: 29 | 30 | ```pebakery 31 | // C:\myFile.ini 32 | [mySection] 33 | myKey=myValue 34 | anotherKey=anotherValue 35 | ``` 36 | 37 | In the following example the value of `1234` will be written to the key `myKey`. 38 | 39 | ```pebakery 40 | IniWrite,C:\myFile.ini,mySection,myKey,1234 41 | ``` 42 | 43 | ## Example 2 44 | 45 | A common usage of IniWrite is to retrieve values from the script interface and write them to an applications configuration file. 46 | 47 | Lets assume we have a program that uses the following .ini file: 48 | 49 | ```pebakery 50 | // C:\myConfig.ini 51 | [Config] 52 | ShowWindow=true 53 | ShowText=MyString 54 | ``` 55 | 56 | Code 57 | 58 | ```pebakery 59 | [Process] 60 | // Store the value of a checkbox in the config file 61 | IniWrite,C:\myConfig.ini,Config,ShowWindow,%pCheckbox1% 62 | 63 | //Store the value of a textbox in the config file 64 | IniWrite,C:\myConfig.ini,Config,MyString,%pText1% 65 | 66 | [Interface] 67 | pText1="Show this text:",1,1,10,8,106,18,8,Normal 68 | pCheckbox1="Show Window?",1,3,10,32,278,18,False 69 | ``` -------------------------------------------------------------------------------- /Commands/INI/IniWriteTextLine.md: -------------------------------------------------------------------------------- 1 | # IniWriteTextLine 2 | 3 | Write a line of text to a section inside a standard .ini file. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | IniWriteTextLine,,
,[,APPEND] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file. | 16 | | Section | The section where the string will be written. | 17 | | Line | The string to write. | 18 | 19 | ### Flags 20 | 21 | | Flag | Description | 22 | | --- | --- | 23 | | APPEND | **(Optional)** If specified this will cause the string to be inserted at the end of the section. | 24 | 25 | ## Remarks 26 | 27 | If `FileName` does not exist it will be created using UTF-8 encoding. 28 | 29 | Unless the `APPEND` flag is specified the `Line` will be inserted at the beginning of the section. 30 | 31 | PEBakery will optimize multiple `IniWriteTextLine` commands in a row into a single write operation. 32 | 33 | ## Example 34 | 35 | Lets assume we have the following .ini file: 36 | 37 | ```pebakery 38 | // C:\myFile.ini 39 | [mySection] 40 | myKey=myValue 41 | anotherKey=anotherValue 42 | ``` 43 | 44 | In the following example the string `Hello World!` will be written to the beginning of the section. 45 | Additionally the string `Goodbye World!` will be written to the end of the section. 46 | 47 | ```pebakery 48 | IniWriteTextLine,C:\myFile.ini,mySection,"Hello World!" 49 | IniWriteTextLine,C:\myFile.ini,mySection,"Goodbye World!",APPEND 50 | ``` 51 | 52 | The resulting .ini file: 53 | 54 | ```pebakery 55 | // C:\myFile.ini 56 | [mySection] 57 | Hello World! 58 | myKey=myValue 59 | anotherKey=anotherValue 60 | Goodbye World! 61 | ``` 62 | -------------------------------------------------------------------------------- /Commands/INI/README.md: -------------------------------------------------------------------------------- 1 | # INI Commands 2 | 3 | These commands allow you to read and write standard .ini formatted files, including PEBakery .script files. 4 | 5 | Click on a Command name for a detailed description. 6 | 7 | | Command | Description | 8 | | --- | --- | 9 | | [IniAddSection](./IniAddSection.md) | Adds a new empty section inside a standard .ini file. | 10 | | [IniCompact](./IniCompact.md) | Compacts an .ini file, removing extra whitespace such as leading/trailing spaces and padding between key=value pairs. | 11 | | [IniDelete](./IniDelete.md) | Deletes a key from a standard .ini file. | 12 | | [IniDeleteSection](./IniDeleteSection.md) | Deletes a section from a standard .ini file. | 13 | | [IniMerge](./IniMerge.md) | Combines the contents of two .ini files. | 14 | | [IniRead](./IniRead.md) | Reads a value from a standard .ini file. | 15 | | [IniReadSection](./IniReadSection.md) | Reads the contents of a section in a standard .ini file and outputs the result as a list structure. | 16 | | [IniWrite](./IniWrite.md) | Writes a value to a standard .ini file. | 17 | | [IniWriteTextLine](./IniWriteTextLine.md) | Writes a line of text to a standard .ini file. | -------------------------------------------------------------------------------- /Commands/Interface/Echo.md: -------------------------------------------------------------------------------- 1 | # Echo 2 | 3 | Display a message in the build window while the script is running. 4 | 5 | This message will persist until another message is displayed or the script execution finishes. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | Echo,[,WARN] 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | Message | The text that will be displayed to the user. | 18 | 19 | ### Flags 20 | 21 | | Flag | Description | 22 | | --- | --- | 23 | | WARN | **(Optional)** Flags the `Message` as a warning in the log. | 24 | 25 | ## Remarks 26 | 27 | `Echo` supports displaying multi-line text when you specify the newline `#$x` escape code. 28 | 29 | `Echo` is most often used for keeping the user updated on what the script is working on, however it can also be used as a debugging tool, as the output of the statement is written to the log. 30 | 31 | ## Related 32 | 33 | [EchoFile](./EchoFile.md), [Message](./Message.md) 34 | 35 | ## Examples 36 | 37 | ### Example 1 38 | 39 | ```pebakery 40 | [main] 41 | Title=Echo Example 42 | Description=Show usage of the Echo command. 43 | Level=5 44 | Version=1 45 | Author=Homes32 46 | 47 | [variables] 48 | %Message1%="Hello World!" 49 | 50 | [process] 51 | Echo,%Message1% 52 | WAIT,5 53 | Echo,"This is a#$xMulti#$xLine#$xMessage!" 54 | WAIT,5 55 | Echo,"Something went very wrong!",WARN 56 | WAIT,5 57 | ``` -------------------------------------------------------------------------------- /Commands/Interface/EchoFile.md: -------------------------------------------------------------------------------- 1 | # EchoFile 2 | 3 | Write the contents of a file to the log. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | EchoFile,[,WARN] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | SrcFile | The full path of the file to be written to the log. | 16 | 17 | ### Flags 18 | 19 | Flags are optional and may be specified in any order. 20 | 21 | | Flag | Description | 22 | | --- | --- | 23 | | WARN | Flags the `Message` as a warning in the log. | 24 | 25 | ## Remarks 26 | 27 | `EchoFile` is designed to be used by developers in order to collect additional logs, config files, etc. to aid in troubleshooting. 28 | 29 | ## Related 30 | 31 | [Echo](./Echo.md), [Message](./Message.md) 32 | 33 | ## Examples 34 | 35 | ### Example 1 36 | 37 | ```pebakery 38 | [main] 39 | Title=EchoFile Example 40 | Description=Show usage of the EchoFile command. 41 | Level=5 42 | Version=1 43 | Author=Homes32 44 | 45 | [variables] 46 | %LogFile%=%BaseDir%\Temp\myLog.txt 47 | 48 | [process] 49 | // Create a dummy log file. 50 | FileCreateBlank,%LogFile% 51 | TXTAddLine,%LogFile%,Line1,Append 52 | TXTAddLine,%LogFile%,Line2,Append 53 | TXTAddLine,%LogFile%,Line3,Append 54 | TXTAddLine,%LogFile%,Line4,Append 55 | TXTAddLine,%LogFile%,Line5,Append 56 | 57 | // EchoFile 58 | EchoFile,%LogFile% 59 | ``` -------------------------------------------------------------------------------- /Commands/Interface/Message.md: -------------------------------------------------------------------------------- 1 | # Message 2 | 3 | Displays a simple message box with optional timeout. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Message,,[,Timeout] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Message | The text that will be displayed to the user. | 16 | | Icon | **(Optional)** Defines the Icon to display. Valid options are: | 17 | || Information/Info - **(Default)** Displays an Information Icon | 18 | || Confirmation/Confirm - Displays a Question Icon | 19 | || Error - Displays a Error Icon | 20 | || Warning/Warn - Displays a Warning Icon | 21 | | Timeout | **(Optional)** Time in seconds before the message automatically closes. | 22 | 23 | ## Remarks 24 | 25 | The exact icon displayed may vary based on your operating system configuration. 26 | 27 | Messages block further processing until the message is acknowledged. Unless the situation requires user intervention it is recommended to set a reasonable timeout period, or use the `Echo` command in order to allow the script to continue processing. 28 | 29 | ## Related 30 | 31 | [Echo](./Echo.md), [If,QUESTION](../Branch/If.md) 32 | 33 | ## Examples 34 | 35 | ### Example 1 36 | 37 | ```pebakery 38 | [main] 39 | Title=Message Example 40 | Description=Show usage of the Message command. 41 | Level=5 42 | Version=1 43 | Author=Homes32 44 | 45 | [variables] 46 | 47 | [process] 48 | Message,"Informational Message",INFORMATION,10 49 | Message,"Error Message",ERROR,10 50 | Message,"Warning Message",WARNING,10 51 | Message,"Confirmation Message",CONFIRMATION,10 52 | ``` 53 | -------------------------------------------------------------------------------- /Commands/Interface/README.md: -------------------------------------------------------------------------------- 1 | # Interface Commands 2 | 3 | Interface commands allow your scripts to interact with the user. 4 | 5 | Click on a Command name for a detailed description. 6 | 7 | | Command | Description | 8 | | --- | --- | 9 | | [AddInterface](./AddInterface.md) | Loads variables from another interface section into the local scope. | 10 | | [Echo](./Echo.md) | Display a message in the build window while the script is running. | 11 | | [EchoFile](./EchoFile.md) | Write the contents of a file to the log. | 12 | | [Message](./Message.md) | Displays a simple message box with optional timeout. | 13 | | [ReadInterface](./ReadInterface.md) | Reads the properties of an interface control. | 14 | | [UserInput](./UserInput.md) | Prompts the user to select a file or directory path. | 15 | | [Visible](./Visible.md) | Sets the visibility of a UI control. | 16 | | [WriteInterface](./WriteInterface.md) | Changes the properties of an interface control. | -------------------------------------------------------------------------------- /Commands/Interface/Visible.md: -------------------------------------------------------------------------------- 1 | # Visible 2 | 3 | Sets the visibility of a UI control. 4 | 5 | **This command has been deprecated and will be removed in a future release. It is recommended that you update your code to use `WriteInterface,Visible` as soon as possible to avoid breaking your script.** 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | Visible,<%Control%>, 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | %Control% | The variable representing the interface control to be modified. | 18 | | Boolean | One of the following values: | 19 | || True - Show the control. | 20 | || False - Hide the control. | 21 | 22 | ## Remarks 23 | 24 | Changes made to an control's visibility are persistent. 25 | 26 | ## Related 27 | 28 | [WriteInterface](./WriteInterface.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | Sample script that will toggle the visibility of a group of controls when the value of a combo box changes. 35 | 36 | ```pebakery 37 | [main] 38 | Title=Visibility Example 39 | Description=Show usage of Visible command 40 | Level=5 41 | Version=1 42 | Author=Homes32 43 | 44 | [variables] 45 | 46 | [process] 47 | 48 | [Toggle_Advanced_Options] 49 | System,CURSOR,WAIT 50 | If,%SB_CfgProfile%,Equal,"Advanced",Begin 51 | Visible,%BVL_AdvOptions%,True 52 | Visible,%LBL_AdvOptions%,True 53 | Visible,%CB_Adv1%,True 54 | Visible,%CB_Adv2%,True 55 | End 56 | Else,Begin 57 | Visible,%BVL_AdvOptions%,False 58 | Visible,%LBL_AdvOptions%,False 59 | Visible,%CB_Adv1%,False 60 | Visible,%CB_Adv2%,False 61 | End 62 | System,CURSOR,NORMAL 63 | 64 | [Interface] 65 | LBL_CfgProfile="Configuration Profile:",1,1,12,16,120,20,8,Bold 66 | SB_CfgProfile=Simple,1,4,135,10,150,21,Simple,Advanced,_Toggle_Advanced_Options_,True 67 | TXT_FilePath="File Path",1,0,16,78,200,21,C:\Temp 68 | BVL_AdvOptions=pBevel1,0,12,10,115,170,80, 69 | LBL_AdvOptions="Advanced Options:",0,1,23,120,147,18,8,Bold 70 | CB_Adv1="Option 1",0,3,20,150,145,20,True 71 | CB_ADV2="Option 2",0,3,20,170,135,20,True 72 | ``` -------------------------------------------------------------------------------- /Commands/List/Append.md: -------------------------------------------------------------------------------- 1 | # List,Append 2 | 3 | Append a value to the end of a list. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | List,Append,<%ListVar%>,[,Delim=] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | ListVar | The variable containing the list. | 16 | | Value | The value to append. | 17 | | Delim= | **(Optional)** Delimiter used to separate the items in the list. Case Insensitive. **Default:** `\|` | 18 | 19 | ## Remarks 20 | 21 | To insert an item at the beginning of a list use the `List,Insert` command. 22 | 23 | ## Related 24 | 25 | [List,Insert](./Insert.md), [List,Set](./Set.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | Append _PEBakery_ to the end of a list. 32 | 33 | ```pebakery 34 | [Main] 35 | Title=List-Append Example 36 | Description=Demonstrate usage of List,Append. 37 | Level=5 38 | Version=1 39 | Author=Homes32 40 | 41 | [Variables] 42 | %myList%=Home|Professional|Enterprise|Starter|Ultimate 43 | 44 | [Process] 45 | List,Append,%myList%,"PEBakery" 46 | Message,"myList: %myList%" 47 | ``` 48 | -------------------------------------------------------------------------------- /Commands/List/Count.md: -------------------------------------------------------------------------------- 1 | # List,Count 2 | 3 | Returns the number of items in a list. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | List,Count,<%ListVar%>,<%DestVar%>[,Delim=] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | ListVar | The variable containing the list. | 16 | | DestVar | The variable where the result will be saved. | 17 | | Delim= | **(Optional)** Delimiter used to separate the items in the list. Case Insensitive. **Default:** `\|` | 18 | 19 | ## Remarks 20 | 21 | The first element of a list is indexed by subscript of 1 (1-based index) and incremented for each additional item in the list. 22 | 23 | ## Related 24 | 25 | ## Examples 26 | 27 | ### Example 1 28 | 29 | Use `List,Count` to retrieve the last item in a list. 30 | 31 | ```pebakery 32 | [Main] 33 | Title=List-Count Example 1 34 | Description=Demonstrate usage of List,Count. 35 | Level=5 36 | Version=1 37 | Author=Homes32 38 | 39 | [Variables] 40 | %myList%=Home|Professional|Enterprise|Starter|Ultimate 41 | 42 | [Process] 43 | List,Count,%myList%,%n% 44 | List,Get,%myList%,%n%,%DestVar% 45 | Message,"Last Item: %DestVar%" 46 | ``` 47 | 48 | ### Example 2 49 | 50 | Loop through an entire list. 51 | 52 | ```pebakery 53 | [Main] 54 | Title=List-Count Example 2 55 | Description=Demonstrate usage of List,Count. 56 | Level=5 57 | Version=1 58 | Author=Homes32 59 | 60 | [Variables] 61 | %myList%=Home|Professional|Enterprise|Starter|Ultimate 62 | 63 | [Process] 64 | List,Count,%myList%,%n% 65 | Loop,%ScriptFile%,GetListItem-Loop,1,%n% 66 | 67 | [GetListItem-Loop] 68 | List,Get,%myList%,#c,%DestVar% 69 | Message,"Item [#c/%n%]: %DestVar%" 70 | ``` -------------------------------------------------------------------------------- /Commands/List/Insert.md: -------------------------------------------------------------------------------- 1 | # List,Insert 2 | 3 | Insert a new value into a specific location in a list. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | List,Insert,<%ListVar%>,,[,Delim=] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | ListVar | The variable containing the list. | 16 | | Index | The index where the item will be written. | 17 | | Value | The value to insert. | 18 | | Delim= | **(Optional)** Delimiter used to separate the items in the list. Case Insensitive. **Default:** `\|` | 19 | 20 | ## Remarks 21 | 22 | `List,Insert` will not overwrite an existing index value, rather it will push the existing value and subsequent items down the list. 23 | 24 | Specifying an `Index` greater then the number of items +1 or less then the number of items in the list will result in an error. 25 | 26 | ## Related 27 | 28 | [List,Append](./Append.md), [List,Set](./Set.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | Prepend _PEBakery_ to the beginning of a list. 35 | 36 | ```pebakery 37 | [Main] 38 | Title=List-Insert Example 1 39 | Description=Demonstrate usage of List,Insert. 40 | Level=5 41 | Version=1 42 | Author=Homes32 43 | 44 | [Variables] 45 | %myList%=Home|Professional|Enterprise|Starter|Ultimate 46 | 47 | [Process] 48 | List,Insert,%myList%,1,"PEBakery" 49 | Message,"myList: %myList%" 50 | ``` 51 | 52 | ### Example 2 53 | 54 | Insert _PEBakery_ to the 4th position in a list. 55 | 56 | ```pebakery 57 | [Main] 58 | Title=List-Insert Example 2 59 | Description=Demonstrate usage of List,Insert. 60 | Level=5 61 | Version=1 62 | Author=Homes32 63 | 64 | [Variables] 65 | %myList%=Home|Professional|Enterprise|Starter|Ultimate 66 | 67 | [Process] 68 | List,Insert,%myList%,4,"PEBakery" 69 | Message,"myList: %myList%" 70 | ``` -------------------------------------------------------------------------------- /Commands/List/LastPos.md: -------------------------------------------------------------------------------- 1 | # List,LastPos 2 | 3 | Returns the last position of the given value inside the specified list. **Case Insensitive.** 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | List,LastPos,<%ListVar%>,,<%DestVar%>[,Delim=] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | ListVar | The variable containing the list. | 16 | | Value | The value to find within the list. | 17 | | DestVar | The variable where the result will be saved. | 18 | | Delim= | **(Optional)** Delimiter used to separate the items in the list. Case Insensitive. **Default:** `\|` | 19 | 20 | ## Remarks 21 | 22 | If the `Value` is not found the `%DestVar%` will return zero. 23 | 24 | If multiple occurrences of `Value` exist within the list only the last occurrence will be returned. 25 | 26 | ## Related 27 | 28 | [List,LastPosX](./LastPosX.md), [List,Pos](./Pos.md), [List,PosX](./PosX.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | Get the index for the last occurrence of _Starter_. 35 | 36 | ```pebakery 37 | [Main] 38 | Title=List-LastPos Example 39 | Description=Demonstrate usage of List,LastPos. 40 | Level=5 41 | Version=1 42 | Author=Homes32 43 | 44 | [variables] 45 | %myList%=Home|UlTiMaTe|StarteR|Professional|Starter|Enterprise|PrOfEsSiOnAl|Starter|Ultimate 46 | 47 | [process] 48 | List,LastPos,%myList%,Starter,%result% 49 | Message,"Last value of [Starter] is at position: %result%" 50 | ``` -------------------------------------------------------------------------------- /Commands/List/LastPosX.md: -------------------------------------------------------------------------------- 1 | # List,LastPosX 2 | 3 | Returns the last position of the given value inside the specified list. **Case Sensitive.** 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | List,LastPosX,<%ListVar%>,,<%DestVar%>[,Delim=] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | ListVar | The variable containing the list. | 16 | | Value | The value to find within the list. | 17 | | DestVar | The variable where the result will be saved. | 18 | | Delim= | **(Optional)** Delimiter used to separate the items in the list. Case Insensitive. **Default:** `\|` | 19 | 20 | ## Remarks 21 | 22 | If the `Value` is not found the `%DestVar%` will return zero. 23 | 24 | If multiple occurrences of `Value` exist within the list only the last occurrence will be returned. 25 | 26 | ## Related 27 | 28 | [List,LastPos](./LastPos.md), [List,Pos](./Pos.md), [List,PosX](./PosX.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | Get the index for the last occurrence of _Starter_. 35 | 36 | ```pebakery 37 | [Main] 38 | Title=List-LastPosX Example 39 | Description=Demonstrate usage of List,LastPosX. 40 | Level=5 41 | Version=1 42 | Author=Homes32 43 | 44 | [variables] 45 | %myList%=Home|UlTiMaTe|StarteR|Professional|Starter|Enterprise|PrOfEsSiOnAl|starter|Ultimate 46 | 47 | [process] 48 | List,LastPosX,%myList%,Starter,%result% 49 | Message,"Last value of [Starter] is at position: %result%" 50 | ``` -------------------------------------------------------------------------------- /Commands/List/Pos.md: -------------------------------------------------------------------------------- 1 | # List,Pos 2 | 3 | Returns the position of the given value inside the specified list. **Case Insensitive.** 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | List,Pos,<%ListVar%>,,<%DestVar%>[,Delim=] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | ListVar | The variable containing the list. | 16 | | Value | The value to find within the list. | 17 | | DestVar | The variable where the result will be saved. | 18 | | Delim= | **(Optional)** Delimiter used to separate the items in the list. Case Insensitive. **Default:** `\|` | 19 | 20 | ## Remarks 21 | 22 | If the `Value` is not found the `%DestVar%` will return zero. 23 | 24 | If multiple occurrences of `Value` exist within the list only the first occurrence will be returned. 25 | 26 | ## Related 27 | 28 | [List,LastPos](./LastPos.md), [List,LastPosX](./LastPosX.md), [List,PosX](./PosX.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | Get the index for the first occurrence of _Starter_. 35 | 36 | ```pebakery 37 | [Main] 38 | Title=List-Pos Example 39 | Description=Demonstrate usage of List,Pos. 40 | Level=5 41 | Version=1 42 | Author=Homes32 43 | 44 | [variables] 45 | %myList%=Home|UlTiMaTe|StarteR|Professional|Starter|Enterprise|PrOfEsSiOnAl|Starter|Ultimate 46 | 47 | [process] 48 | List,Pos,%myList%,Starter,%result% 49 | Message,"Value [Starter] is at position: %result%" 50 | ``` -------------------------------------------------------------------------------- /Commands/List/PosX.md: -------------------------------------------------------------------------------- 1 | # List,PosX 2 | 3 | Returns the position of the given value inside the specified list. **Case Sensitive.** 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | List,PosX,<%ListVar%>,,<%DestVar%>[,Delim=] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | ListVar | The variable containing the list. | 16 | | Value | The value to find within the list. | 17 | | DestVar | The variable where the result will be saved. | 18 | | Delim= | **(Optional)** Delimiter used to separate the items in the list. Case Insensitive. **Default:** `\|` | 19 | 20 | ## Remarks 21 | 22 | If the `Value` is not found the `%DestVar%` will return zero. 23 | 24 | If multiple occurrences of `Value` exist within the list only the first occurrence will be returned. 25 | 26 | ## Related 27 | 28 | [List,LastPos](./LastPos.md), [List,LastPosX](./LastPosX.md), [List,Pos](./Pos.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | Get the index for the first occurrence of _Starter_. 35 | 36 | ```pebakery 37 | [Main] 38 | Title=List-PosX Example 39 | Description=Demonstrate usage of List,PosX. 40 | Level=5 41 | Version=1 42 | Author=Homes32 43 | 44 | [variables] 45 | %myList%=Home|UlTiMaTe|StarteR|Professional|Starter|Enterprise|PrOfEsSiOnAl|Starter|Ultimate 46 | 47 | [process] 48 | List,PosX,%myList%,Starter,%result% 49 | Message,"Value [Starter] is at position: %result%" 50 | ``` -------------------------------------------------------------------------------- /Commands/List/Range.md: -------------------------------------------------------------------------------- 1 | # List,Range 2 | 3 | Generate a list of values from a given number range. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | List,Range,<%ListVar%>,,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | ListVar | The variable containing the list. | 16 | | Start | The starting value in the range. (Integer) | 17 | | End | The ending value in the range. (Integer) | 18 | | Step | Decrement/Increment by this value until `End` is reached. (Integer) | 19 | 20 | ## Remarks 21 | 22 | Setting `` equal to `` will produce an empty list. 23 | 24 | ## Related 25 | 26 | [ForRange](../Branch/ForRange.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | Create a list of numbers that increment from 1 to 10. 33 | 34 | ```pebakery 35 | [Main] 36 | Title=List-Range Example 1 37 | Description=Demonstrate usage of List,Range. 38 | Level=5 39 | Version=1 40 | Author=Homes32 41 | 42 | [Variables] 43 | 44 | [Process] 45 | List,Range,%myList%,1,11,1 46 | Message,"myList: %myList%" 47 | ``` 48 | 49 | ### Example 2 50 | 51 | Create a list of numbers that decrement from 10 to 1. 52 | 53 | ```pebakery 54 | [Main] 55 | Title=List-Range Example 1 56 | Description=Demonstrate usage of List,Range. 57 | Level=5 58 | Version=1 59 | Author=Homes32 60 | 61 | [Variables] 62 | 63 | [Process] 64 | List,Range,%myList%,10,0,-1 65 | Message,"myList: %myList%" 66 | ``` 67 | -------------------------------------------------------------------------------- /Commands/List/RemoveAt.md: -------------------------------------------------------------------------------- 1 | # List,RemoveAt 2 | 3 | Removes a value from a specific index in a list. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | List,RemoveAt,<%ListVar%>,[,Delim=] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | ListVar | The variable containing the list. | 16 | | Index | The index containing the value to be removed. | 17 | | Delim= | **(Optional)** Delimiter used to separate the items in the list. Case Insensitive. **Default:** `\|` | 18 | 19 | ## Remarks 20 | 21 | When a list value is removed by it's index the remaining items will be shifted left. 22 | 23 | ## Related 24 | 25 | [List,Remove](./Remove.md), [List,RemoveX](./RemoveX.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | Remove the item in position 4 from a list. 32 | 33 | ```pebakery 34 | [Main] 35 | Title=List-RemoveAt Example 1 36 | Description=Demonstrate usage of List,RemoveAt. 37 | Level=5 38 | Version=1 39 | Author=Homes32 40 | 41 | [Variables] 42 | %myList%=Home|UlTiMaTe|StarteR|Professional|Starter|Enterprise|PrOfEsSiOnAl|Starter|Ultimate 43 | 44 | [Process] 45 | List,RemoveAt,%myList%,4 46 | Message,"myList: %myList%" 47 | ``` 48 | -------------------------------------------------------------------------------- /Commands/List/Set.md: -------------------------------------------------------------------------------- 1 | # List,Set 2 | 3 | Writes a value to a specific location in a list structure. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | List,Set,<%ListVar%>,,[,Delim=] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | ListVar | The variable containing the list. | 16 | | Index | The index where the item will be written. | 17 | | Value | The value to be written. | 18 | | Delim= | **(Optional)** Delimiter used to separate the items in the list. Case Insensitive. **Default:** `\|` | 19 | 20 | ## Remarks 21 | 22 | Specifying an `Index` greater or less then the number of items in the list will result in an error. 23 | 24 | ## Related 25 | 26 | [List,Append](./Append.md), [List,Insert](./Insert.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | Write _PEBakery_ to the 3rd position in a list. 33 | 34 | ```pebakery 35 | [Main] 36 | Title=List-Set Example 37 | Description=Demonstrate usage of List,Set. 38 | Level=5 39 | Version=1 40 | Author=Homes32 41 | 42 | [Variables] 43 | %myList%=Home|Professional|Enterprise|Starter|Ultimate 44 | 45 | [Process] 46 | List,Set,%myList%,3,"PEBakery" 47 | Message,"myList: %myList%" 48 | ``` 49 | -------------------------------------------------------------------------------- /Commands/Math/Abs.md: -------------------------------------------------------------------------------- 1 | # Math,Abs 2 | 3 | Calculates the absolute value of a number. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Abs,<%DestVar%>, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value | Number. | 17 | 18 | ## Remarks 19 | 20 | None. 21 | 22 | ## Related 23 | 24 | ## Examples 25 | 26 | ### Example 1 27 | 28 | ```pebakery 29 | [Main] 30 | Title=Math-Abs Example 31 | Description=Show usage of the Math,Abs Command 32 | Author=Homes32 33 | Level=5 34 | 35 | [Variables] 36 | 37 | [Process] 38 | Math,Abs,%result%,-32 39 | Message,"Absolute value of -32 = %result%" 40 | ``` -------------------------------------------------------------------------------- /Commands/Math/Add.md: -------------------------------------------------------------------------------- 1 | # Math,Add 2 | 3 | Adds two numbers. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Add,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value1 | The first value in the equation. | 17 | | Value2 | The second value in the equation. | 18 | 19 | ## Remarks 20 | 21 | None. 22 | 23 | ## Related 24 | 25 | ## Examples 26 | 27 | ### Example 1 28 | 29 | ```pebakery 30 | [Main] 31 | Title=Math-Add Example 32 | Description=Show usage of the Math,Add Command 33 | Author=Homes32 34 | Level=5 35 | 36 | [Variables] 37 | 38 | [Process] 39 | Math,Add,%sum%,10,20 40 | Message,"10 + 20 = %sum%" 41 | ``` -------------------------------------------------------------------------------- /Commands/Math/BitAnd.md: -------------------------------------------------------------------------------- 1 | # Math,BitAnd 2 | 3 | Performs a bitwise AND operation. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,BitAnd,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value1 | The first value. | 17 | | Value2 | The second value. | 18 | 19 | ## Remarks 20 | 21 | Hint: You can input Hex values directly into `` and they will be automatically converted to decimal. ex. `Math,BitAnd,%Result%,0xC,0x2F` 22 | 23 | ## Related 24 | 25 | [BitNot](./BitNot.md), [BitOr](./BitOr.md), [BitShift](./BitShift.md), [BitXor](./BitXor.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-BitAnd Example 34 | Description=Show usage of the Math,BitAnd Command 35 | Author=Homes32 36 | Level=5 37 | 38 | [Variables] 39 | 40 | [Process] 41 | Math,BitAnd,%result%,13,7 42 | 43 | // Output Result 44 | Message,"Bitwise AND:#$x#$x00001101 (13)#$x00000111 (7)#$x--------------#$x00000101 (5)#$x#$xReturn: %result%" 45 | ``` -------------------------------------------------------------------------------- /Commands/Math/BitNot.md: -------------------------------------------------------------------------------- 1 | # Math,BitNot 2 | 3 | Performs a bitwise NOT operation. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,BitNot,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value | The value to operate on. | 17 | | Size | Size of the `Value` in bits: `8` `16` `32` `64` | 18 | 19 | ## Remarks 20 | 21 | Hint: You can input Hex values directly into `` and they will be automatically converted to decimal. ex. `Math,BitNot,%Result%,0x2F` 22 | 23 | ## Related 24 | 25 | [BitAnd](./BitAnd.md), [BitOr](./BitOr.md), [BitShift](./BitShift.md), [BitXor](./BitXor.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-BitNot Example 34 | Description=Show usage of the Math,BitNot Command 35 | Author=Homes32 36 | Level=5 37 | 38 | [Variables] 39 | 40 | [Process] 41 | Math,BitNot,%result%,106,32 42 | 43 | // Output Result 44 | Message,"Bitwise NOT:#$x#$x00000000000000000000000001101010 (106)#$x11111111111111111111111110010101 (4294967189)#$x#$xReturn: %result%" 45 | ``` -------------------------------------------------------------------------------- /Commands/Math/BitOr.md: -------------------------------------------------------------------------------- 1 | # Math,BitOr 2 | 3 | Performs a bitwise OR operation. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,BitOr,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value1 | The first value. | 17 | | Value2 | The second value. | 18 | 19 | ## Remarks 20 | 21 | Hint: You can input Hex values directly into `` and they will be automatically converted to decimal. ex. `Math,BitOr,%Result%,0xC,0x2F` 22 | 23 | ## Related 24 | 25 | [BitAnd](./BitAnd.md), [BitNot](./BitNot.md), [BitXor](./BitXor.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-BitOr Example 34 | Description=Show usage of the Math,BitOr Command 35 | Author=Homes32 36 | Level=5 37 | 38 | [Variables] 39 | 40 | [Process] 41 | Math,BitOr,%result%,13,7 42 | 43 | // Output Result 44 | Message,"Bitwise OR:#$x#$x00001101 (13)#$x00000111 (7)#$x--------------#$x00001111 (15)#$x#$xReturn: %result%" 45 | ``` -------------------------------------------------------------------------------- /Commands/Math/BitShift.md: -------------------------------------------------------------------------------- 1 | # Math,BitShift 2 | 3 | Performs a bit shifting operation. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,BitShift,<%DestVar%>,,,,[,UNSIGNED] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value | The number to be shifted. | 17 | | Direction | The direction to shift: `LEFT` or `RIGHT` | 18 | | Shift | The number of bits to shift. | 19 | | Size | Size of the `Value` in bits: `8` `16` `32` `64` | 20 | | UNSIGNED | **(Optional)** Specify that the `Value` is an unsigned integer. | 21 | 22 | ## Remarks 23 | 24 | Hint: You can input Hex values directly into `` and they will be automatically converted to decimal. ex. `Math,BitShift,%Result%,0x2C,LEFT,2` 25 | 26 | ## Related 27 | 28 | [BitAnd](./BitAnd.md), [BitNot](./BitNot.md), [BitOr](./BitOr.md), [BitXor](./BitXor.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | ```pebakery 35 | [Main] 36 | Title=Math-BitShift Example 37 | Description=Show usage of the Math,BitShift Command 38 | Author=Homes32 39 | Level=5 40 | 41 | [Variables] 42 | 43 | [Process] 44 | Math,BitShift,%result1%,14,LEFT,2,32 45 | Math,BitShift,%result2%,14,RIGHT,2,32 46 | 47 | // Output Result 48 | Message,"Perform a Bitwise Shift 2 bits LEFT:#$x#$x00001110 (14)#$x00111000 (56)#$x#$xReturn: %result1%#$x#$xPerform a Bitwise Shift 2 bits RIGHT:#$x#$x00001110 (14)#$x00000011 (3)#$x#$xReturn: %result2%" 49 | ``` -------------------------------------------------------------------------------- /Commands/Math/BitXor.md: -------------------------------------------------------------------------------- 1 | # Math,BitXor 2 | 3 | Performs a bitwise exclusive OR operation. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,BitXor,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value1 | The first value. | 17 | | Value2 | The second value. | 18 | 19 | ## Remarks 20 | 21 | Hint: You can input Hex values directly into `` and they will be automatically converted to decimal. ex. `Math,BitXor,%Result%,0xC,0x2F` 22 | 23 | ## Related 24 | 25 | [BitAnd](./BoolAnd.md), [BitNot](./BitNot.md), [BitShift](./BitShift.md), [BitOr](./BitOr.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-BitXor Example 34 | Description=Show usage of the Math,BitXor Command 35 | Author=Homes32 36 | Level=5 37 | 38 | [Variables] 39 | 40 | [Process] 41 | Math,BitXor,%result%,13,7 42 | 43 | // Output Result 44 | Message,"Bitwise XOR:#$x#$x00001101 (13)#$x00000111 (7)#$x--------------#$x00001010 (10)#$x#$xReturn: %result%" 45 | ``` -------------------------------------------------------------------------------- /Commands/Math/BoolAnd.md: -------------------------------------------------------------------------------- 1 | # Math,BoolAnd 2 | 3 | Performs an AND test on two boolean values. 4 | 5 | A true output results only if both values are true. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | Math,BoolAnd,<%DestVar%>,, 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | DestVar | The variable where the result will be stored. | 18 | | Value1 | The first value in the equation. | 19 | | Value2 | The second value in the equation. | 20 | 21 | ## Remarks 22 | 23 | PEBakery supports standard boolean `True`, `False` comparisons, as well as C-Style integer `Non-Zero = True` and `Zero = False` comparisons. 24 | 25 | ## Related 26 | 27 | [BoolNot](./BoolNot.md), [BoolOr](./BoolOr.md), [BoolXor](./BoolXor.md) 28 | 29 | ## Examples 30 | 31 | ### Example 1 32 | 33 | ```pebakery 34 | [Main] 35 | Title=Math-BoolAnd Example 36 | Description=Show usage of the Math,BoolAnd Command 37 | Author=Homes32 38 | Level=5 39 | 40 | [Variables] 41 | 42 | [Process] 43 | Math,BoolAnd,%result1%,True,True 44 | Math,BoolAnd,%result2%,True,False 45 | Math,BoolAnd,%result3%,False,True 46 | Math,BoolAnd,%result4%,False,False 47 | 48 | // Int Bool 49 | Math,BoolAnd,%result5%,1,1 50 | Math,BoolAnd,%result6%,1,0 51 | Math,BoolAnd,%result7%,0,123 52 | Math,BoolAnd,%result8%,0,0 53 | 54 | // Output Result 55 | Message,"Boolean AND Comparison:#$x[True/True] Return: %result1%#$x[True/False] Return: %result2%#$x[False/True] Return: %result3%#$x[False/False] Return: %result4%#$x[1/1] Return: %result5%#$x[1/0] Return: %result6%#$x[0/123] Return: %result7%#$x[0/0] Return: %result8%" 56 | ``` -------------------------------------------------------------------------------- /Commands/Math/BoolNot.md: -------------------------------------------------------------------------------- 1 | # Math,BoolNot 2 | 3 | Performs an Not test on two boolean values. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,BoolNot,<%DestVar%>, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value | The value to operate on. | 17 | 18 | ## Remarks 19 | 20 | PEBakery supports standard boolean `True`, `False` comparisons, as well as C-Style integer `Non-Zero = True` and `Zero = False` comparisons. 21 | 22 | ## Related 23 | 24 | [BoolAnd](./BoolAnd.md), [BoolOr](./BoolOr.md), [BoolXor](./BoolXor.md) 25 | 26 | ## Examples 27 | 28 | ### Example 1 29 | 30 | ```pebakery 31 | [Main] 32 | Title=Math-BoolNot Example 33 | Description=Show usage of the Math,BoolNot Command 34 | Author=Homes32 35 | Level=5 36 | 37 | [Variables] 38 | 39 | [Process] 40 | Math,BoolNot,%result1%,True 41 | Math,BoolNot,%result2%,False 42 | 43 | // Int Bool 44 | Math,BoolNot,%result3%,0x132 45 | Math,BoolNot,%result4%,0 46 | 47 | // Output Result 48 | Message,"Boolean Not Comparison:#$x[True] Return: %result1%#$x[False] Return: %result2%#$x[0x132] Return: %result3%#$x[0] Return: %result4%" 49 | ``` -------------------------------------------------------------------------------- /Commands/Math/BoolOr.md: -------------------------------------------------------------------------------- 1 | # Math,BoolOr 2 | 3 | Performs an OR test on two boolean values. 4 | 5 | A true output results if any one of the values is true. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | Math,BoolOr,<%DestVar%>,, 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | DestVar | The variable where the result will be stored. | 18 | | Value1 | The first value in the equation. | 19 | | Value2 | The second value in the equation. | 20 | 21 | ## Remarks 22 | 23 | PEBakery supports standard boolean `True`, `False` comparisons, as well as C-Style integer `Non-Zero = True` and `Zero = False` comparisons. 24 | 25 | ## Related 26 | 27 | [BoolAnd](./BoolAnd.md), [BoolNot](./BoolNot.md), [BoolXor](./BoolXor.md) 28 | 29 | ## Examples 30 | 31 | ### Example 1 32 | 33 | ```pebakery 34 | [Main] 35 | Title=Math-BoolOr Example 36 | Description=Show usage of the Math,BoolOr Command 37 | Author=Homes32 38 | Level=5 39 | 40 | [Variables] 41 | 42 | [Process] 43 | Math,BoolOr,%result1%,True,True 44 | Math,BoolOr,%result2%,True,False 45 | Math,BoolOr,%result3%,False,True 46 | Math,BoolOr,%result4%,False,False 47 | 48 | // Int Bool 49 | Math,BoolOr,%result5%,2,1 50 | Math,BoolOr,%result6%,2,0 51 | Math,BoolOr,%result7%,0,1 52 | Math,BoolOr,%result8%,0,0 53 | 54 | // Output Result 55 | Message,"Boolean OR Comparison:#$x[True/True] Return: %result1%#$x[True/False] Return: %result2%#$x[False/True] Return: %result3%#$x[False/False] Return: %result4%#$x[2/1] Return: %result5%#$x[2/0] Return: %result6%#$x[0/1] Return: %result7%#$x[0/0] Return: %result8%" 56 | ``` -------------------------------------------------------------------------------- /Commands/Math/BoolXor.md: -------------------------------------------------------------------------------- 1 | # Math,BoolXor 2 | 3 | Performs an exclusive OR test on two boolean values. 4 | 5 | A true output results if one, and only one, of the values is true. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | Math,BoolXor,<%DestVar%>,, 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | DestVar | The variable where the result will be stored. | 18 | | Value1 | The first value in the equation. | 19 | | Value2 | The second value in the equation. | 20 | 21 | ## Remarks 22 | 23 | PEBakery supports standard boolean `True`, `False` comparisons, as well as C-Style integer `Non-Zero = True` and `Zero = False` comparisons. 24 | 25 | ## Related 26 | 27 | [BoolAnd](./BoolAnd.md), [BoolNot](./BoolNot.md), [BoolOr](./BoolOr.md) 28 | 29 | ## Examples 30 | 31 | ### Example 1 32 | 33 | ```pebakery 34 | [Main] 35 | Title=Math-BoolXor Example 36 | Description=Show usage of the Math,BoolXor Command 37 | Author=Homes32 38 | Level=5 39 | 40 | [Variables] 41 | 42 | [Process] 43 | Math,BoolXor,%result1%,True,True 44 | Math,BoolXor,%result2%,True,False 45 | Math,BoolXor,%result3%,False,True 46 | Math,BoolXor,%result4%,False,False 47 | 48 | // Int Bool 49 | Math,BoolXor,%result5%,-1,-2 50 | Math,BoolXor,%result6%,-234,0 51 | Math,BoolXor,%result7%,0,2341345 52 | Math,BoolXor,%result8%,0,0 53 | 54 | // Output Result 55 | Message,"Boolean XOR Comparison:#$x[True/True] Return: %result1%#$x[True/False] Return: %result2%#$x[False/True] Return: %result3%#$x[False/False] Return: %result4%#$x[-1/-2] Return: %result5%#$x[-234/0] Return: %result6%#$x[0/2341345] Return: %result7%#$x[0/0] Return: %result8%" 56 | ``` -------------------------------------------------------------------------------- /Commands/Math/Ceil.md: -------------------------------------------------------------------------------- 1 | # Math,Ceil 2 | 3 | Returns a number rounded up to the next integer. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Ceil,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value | The number to round up. | 17 | | Unit | Unit to round up to. (ex. Nearest 10, 20, 100, etc) | 18 | 19 | ## Remarks 20 | 21 | File sizes can be rounded up to the nearest Kb/MB/Gb/Tb/Pb using `StrFormat,Ceil`. 22 | 23 | ## Related 24 | 25 | [Floor](./Floor.md), [Round](./Round.md), [StrFormat,Ceil](../String/Ceil.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-Ceil Example 34 | Description=Show usage of the Math,Ceil Command 35 | Author=Homes32 36 | Level=5 37 | 38 | [Variables] 39 | 40 | [Process] 41 | Math,Ceil,%result%,32,10 42 | Message,"32 rounded UP to the nearest 10 = %result%" 43 | ``` -------------------------------------------------------------------------------- /Commands/Math/Dec.md: -------------------------------------------------------------------------------- 1 | # Math,Dec 2 | 3 | Converts a a hexadecimal string to it's numeric representation. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Dec,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Hex | The hex string to be converted. Strings must be prefixed with `0x`. | 17 | | Size | Size of the number in bits: `8` `16` `32` `64`. | 18 | 19 | ## Remarks 20 | 21 | Negative integer conversion is not supported. 22 | 23 | ## Related 24 | 25 | [Math,Hex](./Hex.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-Dec Example 34 | Description=Show the usage of Math,Dec. 35 | Level=5 36 | Version=1 37 | Author=Homes32 38 | 39 | [Variables] 40 | 41 | [process] 42 | Math,Dec,%result1%,0xDEADBEEF,32 43 | Math,Dec,%result2%,0x054C5638,32 44 | Math,Dec,%result3%,0x8BADF00D,32 45 | 46 | Message,"Input: [0xDEADBEEF] Dec: [%result1%]#$x#$xInput: [0x054C5638] Dec: [%result2%]#$x#$xInput: [0x8BADF00D] Dec: [%result3%]" 47 | ``` -------------------------------------------------------------------------------- /Commands/Math/Div.md: -------------------------------------------------------------------------------- 1 | # Math,Div 2 | 3 | Divides two numbers. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Div,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value1 | The first value in the equation. | 17 | | Value2 | The second value in the equation. | 18 | 19 | ## Remarks 20 | 21 | None. 22 | 23 | ## Related 24 | 25 | [IntDiv](./IntDiv.md), [StrFormat,Div](../String/Div.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-Div Example 34 | Description=Show usage of the Math,Div Command 35 | Author=Homes32 36 | Level=5 37 | 38 | [Variables] 39 | 40 | [Process] 41 | Math,Div,%quot%,20,10 42 | Message,"20 / 10 = %quot%" 43 | ``` -------------------------------------------------------------------------------- /Commands/Math/Floor.md: -------------------------------------------------------------------------------- 1 | # Math,Floor 2 | 3 | Returns a number rounded down to the closest integer. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Floor,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value | The number to round down. | 17 | | Unit | Unit to round down to. (ex. Nearest 10, 20, 100, etc) | 18 | 19 | ## Remarks 20 | 21 | File sizes can be rounded down to the nearest Kb/MB/Gb/Tb/Pb using `StrFormat,Floor`. 22 | 23 | ## Related 24 | 25 | [Ceil](./Ceil.md), [Round](./Round.md), [StrFormat,Floor](../String/Floor.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-Floor Example 34 | Description=Show usage of the Math,Floor Command 35 | Author=Homes32 36 | Level=5 37 | 38 | [Variables] 39 | 40 | [Process] 41 | Math,Floor,%result%,32,10 42 | Message,"32 rounded DOWN to the nearest 10 = %result%" 43 | ``` -------------------------------------------------------------------------------- /Commands/Math/FromChar.md: -------------------------------------------------------------------------------- 1 | # Math,FromChar 2 | 3 | Converts an mapped character to it's numerical code point (in Hex). 4 | 5 | Code points usually represent a single grapheme—usually a letter, digit, punctuation mark, or whitespace—but sometimes represent symbols, control characters, or formatting. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | Math,FromChar,<%DestVar%>, 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | DestVar | The variable where the result will be stored. | 18 | | Char | The to be converted to numerical code point. | 19 | 20 | ### Control Characters 21 | 22 | The following control characters are supported: 23 | 24 | | Code | Description | 25 | | --- | --- | 26 | | `#$t` | `0x09` Tab | 27 | | `#$x` | `0x0A` Carriage Return\Newline | 28 | 29 | ## Remarks 30 | 31 | UCS-4 Unicode code points such as emoji are not supported at this time. 32 | 33 | ## Related 34 | 35 | [ToChar](./ToChar.md) 36 | 37 | ## Examples 38 | 39 | ### Example 1 40 | 41 | ```pebakery 42 | [Main] 43 | Title=Math-FromChar Example 44 | Description=Show usage of the Math,FromChar Command 45 | Author=Homes32 46 | Level=5 47 | 48 | [Variables] 49 | 50 | [Process] 51 | // Control Char [0x09] 52 | Math,FromChar,%result1%,"#$t" 53 | // Printable Char [0x41] 54 | Math,FromChar,%result2%,"A" 55 | // Printable Char [0x7C] 56 | Math,FromChar,%result3%,"|" 57 | // Asian Char [0xAC00] 58 | Math,FromChar,%result4%,"가" 59 | // Asian Char [0xD55C] 60 | Math,FromChar,%result5%,"한" 61 | // UCS-2 Symbol [0x2605★] 62 | Math,FromChar,%result6%,"★" 63 | Message,"%result1%#$x%result2%#$x%result3%#$x%result4%#$x%result5%#$x%result6%#$x" 64 | ``` 65 | 66 | ### Example 2 67 | 68 | Advanced example using a `ForRange` loop to print out `A, B, C, ..., Z`. 69 | 70 | ```pebakery 71 | [Main] 72 | Title=Math-FromChar Example 73 | Description=Show usage of the Math,FromChar Command 74 | Author=ied206 75 | Level=5 76 | 77 | [Variables] 78 | 79 | [Process] 80 | Math,FromChar,%A%,A 81 | Math,FromChar,%Z%,Z 82 | Math,Add,%Z%,%Z%,1 83 | ForRange,%i%,%A%,%Z%,1,Begin 84 | Math,FromChar,%ch%,%i% 85 | Echo,%ch% 86 | End 87 | ``` -------------------------------------------------------------------------------- /Commands/Math/Hex.md: -------------------------------------------------------------------------------- 1 | # Math,Hex 2 | 3 | Convert an integer to it's hexadecimal representation. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Hex,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Integer | The Integer to be converted to Hex. | 17 | | Size | Size of the number in bits: `8` `16` `32` `64` | 18 | 19 | ## Remarks 20 | 21 | Negative integer conversion is supported. 22 | 23 | ## Related 24 | 25 | [Math,Dec](./Dec.md), [StrFormat,Hex](../String/Hex.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-Hex Example 34 | Description=Show the usage of Math,Hex. 35 | Level=5 36 | Version=1 37 | Author=Homes32 38 | 39 | [Variables] 40 | 41 | [process] 42 | Math,Hex,%result1%,3735928559,32 43 | Math,Hex,%result2%,88888888,32 44 | Math,Hex,%result3%,2343432205,32 45 | Math,Hex,%result4%,-2,64 46 | Math,Hex,%result5%,-2,32 47 | 48 | Message,"Input: [3735928559] Hex: [%result1%]#$x#$xInput: [88888888] Hex: [%result2%]#$x#$xInput: [2343432205] Hex: [%result3%]#$x#$xInput: [-2] Hex: [%result4%] (64bit)#$x#$xInput: [-2] Hex: [%result5%] (32bit)" 49 | ``` -------------------------------------------------------------------------------- /Commands/Math/IntDiv.md: -------------------------------------------------------------------------------- 1 | # Math,IntDiv 2 | 3 | Divides two integers and returns the quotient and remainder. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,IntDiv,<%QuotientVar%>,<%RemainderVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | QuotientVar | The variable where the result will be stored. | 16 | | RemainderVar | The variable where the remainder will be stored. | 17 | | Value1 | The first value in the equation. | 18 | | Value2 | The second value in the equation. | 19 | 20 | ## Remarks 21 | 22 | None. 23 | 24 | ## Related 25 | 26 | [Div](./Div.md), [StrFormat,Div](../String/Div.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=Math-IntDiv Example 35 | Description=Show usage of the Math,IntDiv Command 36 | Author=Homes32 37 | Level=5 38 | 39 | [Variables] 40 | 41 | [Process] 42 | Math,IntDiv,%quot%,%remain%,634,37 43 | Message,"634 / 37 = %quot% r. %remain%" 44 | ``` -------------------------------------------------------------------------------- /Commands/Math/Mul.md: -------------------------------------------------------------------------------- 1 | # Math,Mul 2 | 3 | Multiplies two numbers. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Mul,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value1 | The first value in the equation. | 17 | | Value2 | The second value in the equation. | 18 | 19 | ## Remarks 20 | 21 | None. 22 | 23 | ## Related 24 | 25 | [StrFormat,Mult](../String/Mult.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-Mul Example 34 | Description=Show usage of the Math,Mul Command 35 | Author=Homes32 36 | Level=5 37 | 38 | [Variables] 39 | 40 | [Process] 41 | Math,Mul,%prod%,20,10 42 | Message,"20 * 10 = %prod%" 43 | ``` -------------------------------------------------------------------------------- /Commands/Math/Neg.md: -------------------------------------------------------------------------------- 1 | # Math,Neg 2 | 3 | Calculates the additive inverse of a value *(n * -1)*. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Neg,<%DestVar%>, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value | The value to invert. | 17 | 18 | ## Remarks 19 | 20 | None. 21 | 22 | ## Related 23 | 24 | ## Examples 25 | 26 | ### Example 1 27 | 28 | ```pebakery 29 | [Main] 30 | Title=Math-Neg Example 31 | Description=Show usage of the Math,Neg Command 32 | Author=Homes32 33 | Level=5 34 | 35 | [Variables] 36 | 37 | [Process] 38 | Math,Neg,%neg%,32 39 | Message,"32: %neg%" 40 | Math,Neg,%neg%,-32 41 | Message,"-32: %neg%" 42 | ``` -------------------------------------------------------------------------------- /Commands/Math/Pow.md: -------------------------------------------------------------------------------- 1 | # Math,Pow 2 | 3 | Raises a number to the power. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Pow,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Base | Base number to raise. | 17 | | PowerOf | The power to raise `Base`. | 18 | 19 | ## Remarks 20 | 21 | None. 22 | 23 | ## Related 24 | 25 | ## Examples 26 | 27 | ### Example 1 28 | 29 | ```pebakery 30 | [Main] 31 | Title=Math-Pow Example 32 | Description=Show usage of the Math,Pow Command 33 | Author=Homes32 34 | Level=5 35 | 36 | [Variables] 37 | 38 | [Process] 39 | Math,Pow,%result%,2,4 40 | Message,"2^4 = %result%" 41 | ``` -------------------------------------------------------------------------------- /Commands/Math/Rand.md: -------------------------------------------------------------------------------- 1 | # Math,Rand 2 | 3 | Generates a pseudo-random positive integer. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Rand,<%DestVar%>[,,] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Min | **(Optional)** A positive integer representing the minimum range. (Default is 0) | 17 | | Max | **(Optional)** A positive integer representing the maximum range. (Default is 65536) | 18 | 19 | If you choose to define a range you must specify both `Min` and `Max` values. 20 | 21 | ## Remarks 22 | 23 | This command is not designed to be cryptographically secure. 24 | 25 | ## Related 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | The following script will generate between 1 to 10 pseudo-random numbers. 32 | 33 | ```pebakery 34 | [Main] 35 | Title=Math-Rand Example 36 | Description=Show usage of the Math,Rand Command 37 | Author=Homes32 38 | Level=5 39 | 40 | [Variables] 41 | 42 | [Process] 43 | Math,Rand,%i%,1,10 44 | Loop,%ScriptFile%,getRandomNum,1,%i% 45 | Message,"Generated [%i%] pseudo-random numbers:#$x#$x%numList%" 46 | 47 | [getRandomNum] 48 | Math,Rand,%randomNumber% 49 | List,Append,%numList%,%randomNumber% 50 | ``` -------------------------------------------------------------------------------- /Commands/Math/Round.md: -------------------------------------------------------------------------------- 1 | # Math,Round 2 | 3 | Returns a integer rounded to the nearest whole number. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Round,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value | The number to round. | 17 | | Unit | Unit to round to. (ex. Nearest 10, 20, 100, etc) | 18 | 19 | ## Remarks 20 | 21 | File sizes can be rounded to the nearest Kb/MB/Gb/Tb/Pb using `StrFormat,Round`. 22 | 23 | ## Related 24 | 25 | [Ceil](./Ceil.md), [Floor](./Floor.md), [StrFormat,Round](../String/Round.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-Round Example 34 | Description=Show usage of the Math,Round Command 35 | Author=Homes32 36 | Level=5 37 | 38 | [Variables] 39 | 40 | [Process] 41 | Math,Round,%result%,1024,1000 42 | Message,"1024 rounded to the nearest 1000 = %result%" 43 | ``` -------------------------------------------------------------------------------- /Commands/Math/Sub.md: -------------------------------------------------------------------------------- 1 | # Math,Sub 2 | 3 | Subtracts two numbers. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,Sub,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Value1 | The first value in the equation. | 17 | | Value2 | The second value in the equation. | 18 | 19 | ## Remarks 20 | 21 | None. 22 | 23 | ## Related 24 | 25 | ## Examples 26 | 27 | ### Example 1 28 | 29 | ```pebakery 30 | [Main] 31 | Title=Math-Sub Example 32 | Description=Show usage of the Math,Sub Command 33 | Author=Homes32 34 | Level=5 35 | 36 | [Variables] 37 | 38 | [Process] 39 | Math,Sub,%diff%,30,10 40 | Message,"30 - 10 = %diff%" 41 | ``` -------------------------------------------------------------------------------- /Commands/Math/ToChar.md: -------------------------------------------------------------------------------- 1 | # Math,ToChar 2 | 3 | Converts an numerical code point to it's mapped character. 4 | 5 | Code points usually represent a single grapheme—usually a letter, digit, punctuation mark, or whitespace—but sometimes represent symbols, control characters, or formatting. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | Math,ToChar,<%DestVar%>, 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | DestVar | The variable where the result will be stored. | 18 | | CodePoint | The numerical code point to be converted to it's mapped character. | 19 | 20 | ### Control Characters 21 | 22 | The following control characters are supported: 23 | 24 | | Code | Description | 25 | | --- | --- | 26 | | 0x09 | `#$t` Tab | 27 | | 0x0A | `#$x` Newline is converted to Carriage Return\Newline | 28 | 29 | ## Remarks 30 | 31 | UCS-4 Unicode code points such as emoji are not supported at this time. 32 | 33 | ## Related 34 | 35 | [FromChar](./FromChar.md) 36 | 37 | ## Examples 38 | 39 | ### Example 1 40 | 41 | ```pebakery 42 | [Main] 43 | Title=Math-ToChar Example 44 | Description=Show usage of the Math,ToChar Command 45 | Author=Homes32 46 | Level=5 47 | 48 | [Variables] 49 | 50 | [Process] 51 | // Control Char [Tab] 52 | Math,ToChar,%result1%,0x09 53 | // Printable Char [A] 54 | Math,ToChar,%result2%,65 55 | // Printable Char [|] 56 | Math,ToChar,%result3%,0x7C 57 | // Asian Char [가] 58 | Math,ToChar,%result4%,0xAC00 59 | // Asian Char [한] 60 | Math,ToChar,%result5%,54620 61 | // UCS-2 Symbol [★] 62 | Math,ToChar,%result6%,0x2605 63 | Message,"%result1%#$x%result2%#$x%result3%#$x%result4%#$x%result5%#$x%result6%#$x" 64 | ``` 65 | 66 | ### Example 2 67 | 68 | Advanced example using a `ForRange` loop to print out `A, B, C, ..., Z`. 69 | 70 | ```pebakery 71 | [Main] 72 | Title=Math-ToChar Example 73 | Description=Show usage of the Math,ToChar Command 74 | Author=ied206 75 | Level=5 76 | 77 | [Variables] 78 | 79 | [Process] 80 | Math,FromChar,%A%,A 81 | Math,FromChar,%Z%,Z 82 | Math,Add,%Z%,%Z%,1 83 | ForRange,%i%,%A%,%Z%,1,Begin 84 | Math,ToChar,%ch%,%i% 85 | Echo,%ch% 86 | End 87 | ``` -------------------------------------------------------------------------------- /Commands/Math/ToSign.md: -------------------------------------------------------------------------------- 1 | # Math,ToSign 2 | 3 | Converts an Unsigned Integer to a Signed Integer. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,ToSign,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Integer | The Unsigned Integer to be converted to Signed Integer. | 17 | | Size | Size of the number in bits: `8` `16` `32` `64` | 18 | 19 | ## Remarks 20 | 21 | None. 22 | 23 | ## Related 24 | 25 | [ToUnsign](./ToUnsign.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-ToSign Example 34 | Description=Show usage of the Math,ToSign Command 35 | Author=Homes32 36 | Level=5 37 | 38 | [Variables] 39 | 40 | [Process] 41 | Math,ToSign,%result%,4294934528,32 42 | Message,"%result%" 43 | ``` -------------------------------------------------------------------------------- /Commands/Math/ToUnsign.md: -------------------------------------------------------------------------------- 1 | # Math,ToUnSign 2 | 3 | Converts an Signed Integer to an Unsigned Integer. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | Math,ToUnsign,<%DestVar%>,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the result will be stored. | 16 | | Integer | The Integer to be converted to Unsigned Integer. | 17 | | Size | Size of the number in bits: `8` `16` `32` `64` | 18 | 19 | ## Remarks 20 | 21 | None. 22 | 23 | ## Related 24 | 25 | [ToSign](./ToSign.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=Math-ToUnsign Example 34 | Description=Show usage of the Math,ToUnsign Command 35 | Author=Homes32 36 | Level=5 37 | 38 | [Variables] 39 | 40 | [Process] 41 | Math,ToUnSign,%result%,-32768,32 42 | Message,"%result%" 43 | ``` -------------------------------------------------------------------------------- /Commands/Network/README.md: -------------------------------------------------------------------------------- 1 | # Network Commands 2 | 3 | These commands allow you to perform network related tasks such as downloading files from the Internet. 4 | 5 | Click on a Command name for a detailed description. 6 | 7 | | Command | Description | 8 | | --- | --- | 9 | | [WebGet](./WebGet.md) | Downloads files from the Internet. | -------------------------------------------------------------------------------- /Commands/Registry/README.md: -------------------------------------------------------------------------------- 1 | # Registry Commands 2 | 3 | These commands allow you to read and write values from the local registry. You can also load and modify external registry hives belonging to the project. 4 | 5 | Click on a Command name for a detailed description. 6 | 7 | | Command | Description | 8 | | --- | --- | 9 | | [RegCopy](./RegCopy.md) | Copies all subkeys and values from one registry key to another. | 10 | | [RegDelete](./RegDelete.md) | Deletes a key or value from the registry. | 11 | | [RegExport](./RegExport.md) | Exports the contents of a registry key to a *.reg file. | 12 | | [RegHiveLoad](./RegHiveLoad.md) | Loads an external registry hive onto your local registry. | 13 | | [RegHiveUnload](./RegHiveUnload.md) | Unloads an external registry hive from your local registry. | 14 | | [RegImport](./RegImport.md) | Imports the contents of a registry file (*.reg) to your local registry system. | 15 | | [RegMulti](./RegMulti.md) | Modify a multi-string value in the registry. | 16 | | [RegRead](./RegRead.md) | Reads a value from the registry. | 17 | | [RegWrite](./RegWrite.md) | Create or modify a key or value in the registry. | 18 | | [RegWriteEx](./RegWriteEx.md) | Create or modify a key or value in the registry without verifying the ValueType. | -------------------------------------------------------------------------------- /Commands/Registry/RegDelete.md: -------------------------------------------------------------------------------- 1 | # RegDelete 2 | 3 | Deletes a key or value from the registry. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | RegDelete,,[,ValueName] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | HKEY | The root key must be one of the following: | 16 | || HKEY_LOCAL_MACHINE or HKLM | 17 | || HKEY_CURRENT_CONFIG or HKCC | 18 | || HKEY_CLASSES_ROOT or HKCR | 19 | || HKEY_CURRENT_USER or HKCU | 20 | || HKEY_USERS or HKU | 21 | | KeyPath | The full path of the registry key. | 22 | | ValueName | **(Optional)** The value to be deleted. If `ValueName` is not specified the entire registry key will be removed. | 23 | 24 | ## Remarks 25 | 26 | None. 27 | 28 | ## Related 29 | 30 | [RegHiveLoad](./RegHiveLoad.md), [RegHiveUnload](./RegHiveUnload.md) 31 | 32 | ## Examples 33 | 34 | ### Example 1 35 | 36 | Delete a registry value. 37 | 38 | ```pebakery 39 | RegHiveLoad,Tmp_System,%RegSystem% 40 | RegDelete,HKLM,Tmp_System\ControlSet001\Services\VgaSave\Device0,DefaultSettings.XResolution 41 | RegHiveUnLoad,Tmp_System 42 | ``` 43 | 44 | ### Example 2 45 | 46 | Delete a registry key. 47 | 48 | ```pebakery 49 | RegHiveLoad,Tmp_System,%RegSystem% 50 | RegDelete,HKLM,Tmp_System\ControlSet001\Services\VgaSave\Device0 51 | RegHiveUnLoad,Tmp_System 52 | ``` 53 | -------------------------------------------------------------------------------- /Commands/Registry/RegExport.md: -------------------------------------------------------------------------------- 1 | # RegExport 2 | 3 | Exports the contents of a registry key to a *.reg file. 4 | 5 | This command has the same effect as running `REG.exe EXPORT /Y` from Windows. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | RegExport,,, 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | HKEY | The root key must be one of the following: | 18 | || HKEY_LOCAL_MACHINE or HKLM | 19 | || HKEY_CURRENT_CONFIG or HKCC | 20 | || HKEY_CLASSES_ROOT or HKCR | 21 | || HKEY_CURRENT_USER or HKCU | 22 | || HKEY_USERS or HKU | 23 | | KeyPath | The full path of the registry key to export. | 24 | | RegFile | The full path of the target *.reg file. If `RegFile` exists it will be overwritten. | 25 | 26 | ## Remarks 27 | 28 | `RegImport` will export from your **local** registry, so you must ensure that `KeyPath` points to your mounted PE hive if you intend to export from the PE registry. 29 | 30 | ## Related 31 | 32 | [RegHiveLoad](./RegHiveLoad.md), [RegHiveUnload](./RegHiveUnload.md) 33 | 34 | ## Examples 35 | 36 | ### Example 1 37 | 38 | ```pebakery 39 | // Make sure RegHiveLoad, matches the path in your *.reg file 40 | RegHiveLoad,Tmp_System,%RegSystem% 41 | RegExport,HKEY_LOCAL_MACHINE,Tmp_System\ControlSet001\Control\Network,c:\myFile.reg 42 | RegHiveUnLoad,Tmp_System 43 | ``` -------------------------------------------------------------------------------- /Commands/Registry/RegHiveLoad.md: -------------------------------------------------------------------------------- 1 | # RegHiveLoad 2 | 3 | Loads an external registry hive onto your local registry. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | RegHiveLoad,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | KeyPath | The registry key where `HiveFile` will be loaded. | 16 | | HiveFile | The full path of the registry hive to load. | 17 | 18 | ## Remarks 19 | 20 | If the `HiveFile` does not exist an empty registry hive will be created with the specified name. 21 | 22 | `RegHiveLoad` will always load the `KeyPath` under the local registry **HKLM** key. 23 | 24 | A registry hive mounted with `RegHiveLoad` should be unmounted with `RegHiveUnload`. 25 | 26 | ## Related 27 | 28 | [RegHiveUnload](./RegHiveUnload.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | Most projects will define a set of variables containing paths to the registry hives to make development easier. 35 | Common examples of this are: 36 | 37 | ```pebakery 38 | %RegSystem%=%TargetDir%\Windows\System32\config\System 39 | %RegSoftware%=%TargetDir%\Windows\System32\config\Software 40 | %RegDefault%=%TargetDir%\Windows\System32\config\Default 41 | %RegComponents%=%TargetDir%\Windows\System32\config\Components 42 | ``` 43 | 44 | In this example we will load the project defined HKLM\Software hive onto a key called `Tmp_Software` in our local registry. 45 | 46 | ```pebakery 47 | // Load the Software Hive (%RegSoftware% is defined by the project) 48 | RegHiveLoad,Tmp_Software,%RegSoftware% 49 | Echo,"Writing new values on registry hive.." 50 | RegWrite,HKLM,0x1,"Tmp_Software\MyProgram","ProgramVersion","1.2.3" 51 | // Always unload when we are finished. 52 | RegHiveUnLoad,Tmp_Software 53 | ``` 54 | ### Example 2 55 | 56 | ```pebakery 57 | RegHiveLoad,Tmp_Setup,%targetdir%\I386\system32\setupreg.hiv 58 | // Always unload when we are finished. 59 | RegHiveUnLoad,Tmp_Setup 60 | ``` -------------------------------------------------------------------------------- /Commands/Registry/RegHiveUnload.md: -------------------------------------------------------------------------------- 1 | # RegHiveUnload 2 | 3 | Unloads an external registry hive from your local registry. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | RegHiveLoad, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | KeyPath | The registry key where the hive is loaded. | 16 | 17 | ## Remarks 18 | 19 | A registry hive mounted with `RegHiveLoad` should be unmounted with `RegHiveUnload`. 20 | 21 | ## Related 22 | 23 | [RegHiveLoad](./RegHiveLoad.md) 24 | 25 | ## Examples 26 | 27 | #### Example 1 28 | 29 | ```pebakery 30 | RegHiveUnload,Tmp_Software 31 | ``` -------------------------------------------------------------------------------- /Commands/Registry/RegRead.md: -------------------------------------------------------------------------------- 1 | # RegRead 2 | 3 | Reads a value from the registry. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | RegRead,,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | HKEY | The root key must be one of the following: | 16 | || HKEY_LOCAL_MACHINE or HKLM | 17 | || HKEY_CURRENT_CONFIG or HKCC | 18 | || HKEY_CLASSES_ROOT or HKCR | 19 | || HKEY_CURRENT_USER or HKCU | 20 | || HKEY_USERS or HKU | 21 | | KeyPath | The full path of the registry key. | 22 | | ValueName | The name of the value. | 23 | | DestVar | The %Variable% where the value will stored. | 24 | 25 | ## Remarks 26 | 27 | If the registry key does not exist the operation will fail. 28 | 29 | ## Related 30 | 31 | [RegHiveLoad](./RegHiveLoad.md), [RegHiveUnload](./RegHiveUnload.md) 32 | 33 | ## Examples 34 | 35 | ### Example 1 36 | 37 | ```pebakery 38 | RegHiveLoad,Tmp_System,%RegSystem% 39 | RegRead,HKLM,Tmp_System\ControlSet001\Services\VgaSave\Device0,DefaultSettings.XResolution,%myXresolution% 40 | Echo, %myXresolution% 41 | RegHiveUnLoad,Tmp_System 42 | ``` -------------------------------------------------------------------------------- /Commands/Script/ExtractAllFiles.md: -------------------------------------------------------------------------------- 1 | # ExtractAllFiles 2 | 3 | Extracts all files from the specified directory inside a script. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | ExtractAllFiles,,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | ScriptFile | The full path to the script. **Hint:** Use `%ScriptFile%` to reference the current script. | 16 | | DirName | The folder inside the script that contains the files. | 17 | | DestDir | The full path of the target directory. If the files to be extracted already exist they will be overwritten. | 18 | 19 | ## Remarks 20 | 21 | None. 22 | 23 | ## Related 24 | 25 | [Encode](./Encode.md), [ExtractFile](./ExtractFile.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | Simple directory structure inside a script. 32 | 33 | ```pebakery 34 | root/ 35 | |--- Folder/ 36 | |--- myApp.exe 37 | |--- myApp.ini 38 | |--- moreFiles.7z 39 | |--- Reg/ 40 | |--- mySettings.reg 41 | |--- src/ 42 | |---mySrc.au3 43 | ``` 44 | 45 | Extract all files contained in the *Folder* directory of the running script to C:\Temp. 46 | 47 | ```pebakery 48 | ExtractAllFiles,%ScriptFile%,Folder,C:\Temp 49 | ``` -------------------------------------------------------------------------------- /Commands/Script/ExtractFile.md: -------------------------------------------------------------------------------- 1 | # ExtractFile 2 | 3 | Extracts a single file from inside a script. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | ExtractFile,,,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | ScriptFile | The full path to the script. **Hint:** Use `%ScriptFile%` to reference the current script. | 16 | | DirName | The folder inside the script that contains the file. | 17 | | FileName | The name of the file to extract. | 18 | | DestDir | The full path of the target directory. If `FileName` already exists it will be overwritten. | 19 | 20 | ## Remarks 21 | 22 | None. 23 | 24 | ## Related 25 | 26 | [Encode](./Encode.md), [ExtractAllFiles](./ExtractAllFiles.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | Simple directory structure inside a script. 33 | 34 | ```pebakery 35 | root/ 36 | |--- Folder/ 37 | |--- myApp.exe 38 | |--- myApp.ini 39 | |--- moreFiles.7z 40 | |--- Reg/ 41 | |--- mySettings.reg 42 | |--- src/ 43 | |---mySrc.au3 44 | ``` 45 | 46 | Extract mySettings.reg from the running script's *Reg* directory. 47 | 48 | ```pebakery 49 | ExtractFile,%ScriptFile%,Reg,mySettings.reg,c:\Temp 50 | ``` -------------------------------------------------------------------------------- /Commands/Script/README.md: -------------------------------------------------------------------------------- 1 | # Script Commands 2 | 3 | Script commands allow you to modify a .script file, including encoding and extracting attachments. 4 | 5 | Click on a Command name for a detailed description. 6 | 7 | | Command | Description | 8 | | --- | --- | 9 | | [Encode](./Encode.md) | Embeds files inside a script. | 10 | | [ExtractFile](./ExtractFile.md) | Extracts a single file from inside a script. | 11 | | [ExtractAndRun](./ExtractAndRun.md) | Extracts a single file from inside a script and executes it. | 12 | | [ExtractAllFiles](./ExtractAllFiles.md) | Extracts all files from the specified directory inside a script. | -------------------------------------------------------------------------------- /Commands/String/BytesToInt.md: -------------------------------------------------------------------------------- 1 | # StrFormat,BytesToInt 2 | 3 | Converts a human readable string representing the size of a file or directory to a machine readable integer representing the size in bytes. 4 | 5 | Strings can be converted to bytes from KB, MB, GB, TB or PB. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | StrFormat,BytesToInt,,<%DestVar%> 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | String | String containing the formated size. | 18 | | DestVar | Variable where the resulting bytes will be stored. | 19 | 20 | ## Remarks 21 | 22 | This operation can be used to reverse the `StrFormat,IntToBytes` command and convert human readable sizes into machine readable format. 23 | 24 | Whitespace in the string is discarded, so `5.123GB` is treated the same as `5.123 GB`. 25 | 26 | ## Related 27 | 28 | [DirSize](../File/DirSize.md), [FileSize](../File/FileSize.md), [StrFormat, IntToBytes](./IntToBytes.md), [System,GetFreeSpace](../System/GetFreeSpace.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | In this example we convert a string containing the size `5.274GB` into bytes. 35 | 36 | ```pebakery 37 | [Main] 38 | Title=BytesToInt 39 | Description=Show the usage of StrFormat,BytesToInt. 40 | Level=5 41 | Version=1 42 | Author=Homes32 43 | 44 | [Variables] 45 | %StrSize%="5.274GB" 46 | 47 | [process] 48 | // Use StrFormat to convert the human readable format to machine readable format. 49 | StrFormat,BytesToInt,%StrSize%,%Size% 50 | Message,"Size: %StrSize% (%Size% bytes)" 51 | ``` -------------------------------------------------------------------------------- /Commands/String/CTrim.md: -------------------------------------------------------------------------------- 1 | # StrFormat,CTrim 2 | 3 | Removes specific character(s) from the beginning or end of a string if they exist. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,CTrim,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | Chars | The character(s) to trim. | 17 | | DestVar | The variable where the result will be saved. | 18 | 19 | ## Remarks 20 | 21 | If `Chars` do not exist at the beginning or end of the string it will not be modified. 22 | 23 | This command can be used to remove (Trim) trailing `\` characters from the start or end of a path, without having a separate statement to check if they exist. 24 | 25 | ## Related 26 | 27 | [StrFormat,Left](./Left.md), [StrFormat,Right](./Right.md), [StrFormat,Len](./Len.md), [StrFormat,Mid](./Mid.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,UCase](./UCase.md), [StrFormat,LCase](./LCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,PosX](./PosX.md), [StrFormat,Replace](./Replace.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 28 | 29 | ## Examples 30 | 31 | ### Example 1 32 | 33 | ```pebakery 34 | [Main] 35 | Title=StrFormat-CTrim Example 36 | Description=Demonstrate usage of StrFormat,CTrim. 37 | Level=5 38 | Version=1 39 | Author=Homes32 40 | 41 | [variables] 42 | %string%="%BaseDir%\Projects\" 43 | %URL%="https://www.google.com" 44 | 45 | [process] 46 | StrFormat,CTrim,%string%,"\",%result% 47 | Message,"After removing [\] characters the remaining string is: %result%" 48 | StrFormat,CTrim,%URL%,"https://",%result% 49 | Message,"After removing [https://] characters the remaining string is: %result%" 50 | ``` -------------------------------------------------------------------------------- /Commands/String/Ceil.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Ceil 2 | 3 | Rounds a value up to the next formatted "size" (KB/MB/GB/TB/PB). 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,Ceil,<%Integer%>, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Integer | Variable containing the number to round up. | 16 | | CeilTo | Size to round up to. Can be one of the following: | 17 | || - An positive integer representing the number of bytes to Ceil. | 18 | || K - Round up to the next Kilobyte | 19 | || M - Round up to the next Megabyte | 20 | || G - Round up to the next Gigabyte | 21 | || T - Round up to the next Terabyte | 22 | || P - Round up to the next Petabyte | 23 | 24 | ## Remarks 25 | 26 | The `Integer` variable is overwritten with the result of the `StrFormat,Ceil` operation. 27 | 28 | This command can be used in conjunction with `StrFormat,IntToBytes` to return at human readable size rounded up to the specified ceiling. 29 | 30 | For mathematical Ceiling operations use the `Math,Ceil` command. 31 | 32 | ## Related 33 | 34 | [Math,Ceil](../Math/Ceil.md), [Math,Floor](../Math/Floor.md), [Math,Round](../Math/Round.md), [StrFormat,Floor](./Floor.md), [StrFormat,IntToBytes](./IntToBytes.md), [StrFormat,Round](./Round.md) 35 | 36 | ## Examples 37 | 38 | ### Example 1 39 | 40 | In this example we get the size of a directory in bytes, then use `StrFormat,Ceil` to round up to the next Gigabyte and finally format our result with `StrFormat,IntToBytes`. 41 | 42 | ```pebakery 43 | [Main] 44 | Title=StrFormat-Ceil 45 | Description=Show the usage of StrFormat,Ceil. 46 | Level=5 47 | Version=1 48 | Author=Homes32 49 | 50 | [Variables] 51 | %Dir%=C:\Windows\System32 52 | 53 | [process] 54 | DirSize,%Dir%,%Bytes% 55 | // Lets see what our formatted size is before rounding 56 | StrFormat,IntToBytes,%Bytes%,%StrSize% 57 | // Round Bytes up to the next Gigabyte 58 | StrFormat,Ceil,%Bytes%,g 59 | // Use StrFormat to convert the size to a more human readable format. 60 | StrFormat,IntToBytes,%Bytes%,%StrCeilSize% 61 | Message,"Bytes: [%Bytes%]#$xFormatted: [%StrSize%]#$xCeil: [%StrCeilSize%]" 62 | ``` -------------------------------------------------------------------------------- /Commands/String/Dec.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Dec 2 | 3 | Decrements a number or letter by a value of *n*. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,Dec,<%DestVar%>, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable containing the value to decrement. | 16 | | Integer | Decrease the value of `DestVar` by `Integer`. | 17 | 18 | ## Remarks 19 | 20 | The result of the operation will be written back into `%DestVar%`. 21 | 22 | This command supports letters of the alphabet as well as integers, allowing you to cycle through a range of drive letters. 23 | 24 | `Integer` must be a positive value. If you need to Increment a number or drive letter use `StrFormat,Inc`. 25 | 26 | ## Related 27 | 28 | [Loop](../Branch/Loop.md), [Math,Add](../Math/Add.md), [Math,Sub](../Math/Sub.md), [StrFormat,Inc](./Inc.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | ```pebakery 35 | [Main] 36 | Title=StrFormat-Dec Example 37 | Description=Demonstrate usage of StrFormat,Dec. 38 | Level=5 39 | Version=1 40 | Author=Homes32 41 | 42 | [variables] 43 | %int%=10 44 | %letter%=Z 45 | 46 | [process] 47 | StrFormat,Dec,%int%,5 48 | StrFormat,Dec,%letter%,1 49 | Message,"Dec [10] by [5] = [%int%]#$xDec [Z] by [1] = [%letter%]" 50 | ``` -------------------------------------------------------------------------------- /Commands/String/DirPath.md: -------------------------------------------------------------------------------- 1 | # StrFormat,DirPath 2 | 3 | **Alias**: `StrFormat,Path` 4 | 5 | Returns a path without the filename or extension. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | StrFormat,DirPath,,<%DestVar%> 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | FilePath | The full path of the file. This can also be a URL. | 18 | | DestVar | Variable where the result will be stored. | 19 | 20 | ## Remarks 21 | 22 | If `FilePath` does not exist the operation will fail. 23 | 24 | ## Related 25 | 26 | [StrFormat,Ext](./Ext.md), [StrFormat,FileName](./FileName.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=StrFormat-DirPath 35 | Description=Show usage of the StrFormat,DirPath Command 36 | Author=Homes32 37 | Level=5 38 | Version=1 39 | 40 | [Variables] 41 | %File%=C:\Windows\System32\HAL.DLL 42 | 43 | [Process] 44 | StrFormat,DirPath,%File%,%result% 45 | Message,"DirPath: %result%" 46 | ``` 47 | 48 | ### Example 2 49 | 50 | Retrieve the FileName and Path from a URL. 51 | 52 | ```pebakery 53 | [Main] 54 | Title=StrFormat-DirPath2 55 | Description=Show usage of the StrFormat,DirPath Command 56 | Author=Homes32 57 | Level=5 58 | Version=1 59 | 60 | [Variables] 61 | %URL%=http://live.sysinternals.com/Bginfo.exe 62 | 63 | [Process] 64 | StrFormat,FileName,%URL%,%name% 65 | StrFormat,DirPath,%URL%,%path% 66 | Message,"Downloading %name% from#$x%path%" 67 | ``` -------------------------------------------------------------------------------- /Commands/String/Div.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Div 2 | 3 | Divides two numbers. 4 | 5 | **This command has been deprecated and may be removed in a future release. It is recommended that you update your code to use `Math,Div` as soon as possible to avoid breaking your script.** 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | StrFormat,Div,<%DestVar%>, 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | DestVar | Variable containing the number to divided. | 18 | | Integer | The number to divide `DestVar` by. | 19 | 20 | ## Remarks 21 | 22 | The result of the operation will be written back into `%DestVar%`. 23 | 24 | ## Related 25 | 26 | [StrFormat,Mult](./Mult.md), [Math,Div](../Math/Div.md), [Math,IntDiv](../Math/IntDiv.md), [Math,Mul](../Math/Mul.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=StrFormat-Div Example 35 | Description=Show usage of the StrFormat,Div Command 36 | Author=Homes32 37 | Level=5 38 | 39 | [Variables] 40 | %int%=20 41 | 42 | [Process] 43 | StrFormat,Div,%int%,10 44 | Message,"20 / 10 = %int%" 45 | ``` -------------------------------------------------------------------------------- /Commands/String/Ext.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Ext 2 | 3 | Returns the file extension from a path. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,Ext,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FilePath | The full path of the file. This can also be a URL. | 16 | | DestVar | Variable where the result will be stored. | 17 | 18 | ## Remarks 19 | 20 | If `FilePath` does not exist the operation will fail. 21 | 22 | ## Related 23 | 24 | [StrFormat,DirPath](./DirPath.md), [StrFormat,FileName](./FileName.md) 25 | 26 | ## Examples 27 | 28 | ### Example 1 29 | 30 | ```pebakery 31 | [Main] 32 | Title=StrFormat-Ext 33 | Description=Show usage of the StrFormat,Ext Command 34 | Author=Homes32 35 | Level=5 36 | Version=1 37 | 38 | [Variables] 39 | %File%=C:\Windows\System32\HAL.DLL 40 | 41 | [Process] 42 | StrFormat,Ext,%File%,%result% 43 | Message,"File Ext: %result%" 44 | ``` -------------------------------------------------------------------------------- /Commands/String/FileName.md: -------------------------------------------------------------------------------- 1 | # StrFormat,FileName 2 | 3 | Returns the filename (including the file extension) portion of a path. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,FileName,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FilePath | The full path of the file. This can also be a URL. | 16 | | DestVar | Variable where the result will be stored. | 17 | 18 | ## Remarks 19 | 20 | If `FilePath` does not exist the operation will fail. 21 | 22 | ## Related 23 | 24 | [StrFormat,DirPath](./DirPath.md), [StrFormat,Ext](./Ext.md) 25 | 26 | ## Examples 27 | 28 | ### Example 1 29 | 30 | ```pebakery 31 | [Main] 32 | Title=StrFormat-FileName 33 | Description=Show usage of the StrFormat,FileName Command 34 | Author=Homes32 35 | Level=5 36 | Version=1 37 | 38 | [Variables] 39 | %File%=C:\Windows\System32\HAL.DLL 40 | 41 | [Process] 42 | StrFormat,FileName,%File%,%result% 43 | Message,"FileName: %result%" 44 | ``` 45 | 46 | ### Example 2 47 | 48 | Retrieve the FileName and Path from a URL. 49 | 50 | ```pebakery 51 | [Main] 52 | Title=StrFormat-FileName2 53 | Description=Show usage of the StrFormat,FileName Command 54 | Author=Homes32 55 | Level=5 56 | Version=1 57 | 58 | [Variables] 59 | %URL%=http://live.sysinternals.com/Bginfo.exe 60 | 61 | [Process] 62 | StrFormat,FileName,%URL%,%name% 63 | StrFormat,DirPath,%URL%,%path% 64 | Message,"Downloading %name% from#$x%path%" 65 | ``` -------------------------------------------------------------------------------- /Commands/String/Hex.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Hex 2 | 3 | Convert an integer to it's hexadecimal representation. 4 | 5 | **This command is included for compatibility with Winbuilder 082. It is recommended that you update your code to use the more flexible `Math,Hex` command.** 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | StrFormat,Hex,,<%DestVar%> 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | Integer | Number to convert. | 18 | | DestVar | Variable where the resulting Hex representation will be stored. | 19 | 20 | ## Remarks 21 | 22 | Negative integer conversion is supported. 23 | 24 | For backwards compatibility with Winbuilder only 32bit integers are supported. 25 | 26 | ## Related 27 | 28 | [Math,Hex](../Math/Hex.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | ```pebakery 35 | [Main] 36 | Title=StrFormat-Hex 37 | Description=Show the usage of StrFormat,Hex. 38 | Level=5 39 | Version=1 40 | Author=Homes32 41 | 42 | [Variables] 43 | %Int1%=88888888 44 | %Int2%=-2 45 | 46 | [process] 47 | StrFormat,Hex,%Int1%,%result1% 48 | StrFormat,Hex,%Int2%,%result2% 49 | Message,"Input: [%Int1%] Hex: [0x%result1%]#$xInput: [%Int2%] Hex: [0x%result2%]" 50 | ``` -------------------------------------------------------------------------------- /Commands/String/Inc.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Inc 2 | 3 | Increments a number or letter by a value of *n*. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,Inc,<%DestVar%>, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable containing the value to increment. | 16 | | Integer | Increase the value of `DestVar` by `Integer`. | 17 | 18 | ## Remarks 19 | 20 | The result of the operation will be written back into `%DestVar%`. 21 | 22 | This command supports letters of the alphabet as well as integers, allowing you to cycle through a range of drive letters lexicographically. 23 | 24 | `Integer` must be a positive value. If you need to Decrement a number or drive letter use `StrFormat,Dec`. 25 | 26 | ## Related 27 | 28 | [Loop](../Branch/Loop.md),[LoopLetter](../Branch/LoopLetter.md), [Math,Add](../Math/Add.md), [Math,Sub](../Math/Sub.md), [StrFormat,Dec](./Dec.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | ```pebakery 35 | [Main] 36 | Title=StrFormat-Inc Example 37 | Description=Demonstrate usage of StrFormat,Inc. 38 | Level=5 39 | Version=1 40 | Author=Homes32 41 | 42 | [variables] 43 | %int%=10 44 | 45 | [process] 46 | StrFormat,Inc,%int%,5 47 | Message,"Inc [10] by [5] = [%int%]" 48 | ``` 49 | 50 | ### Example 2 51 | 52 | In this example we use `StrFormat,Inc` in conjunction with the `Loop` command to cycle through the drive letters A-Z searching for notepad.exe. 53 | 54 | ```pebakery 55 | [Main] 56 | Title=StrFormat-Inc A-Z Example 57 | Description=Demonstrate how to loop through drive letters searching for a file. 58 | Level=5 59 | Version=2 60 | Author=Homes32 61 | 62 | [variables] 63 | 64 | [process] 65 | Set,%searchFile%,"Windows\notepad.exe" 66 | Loop,%ScriptFile%,Search-Drives,1,26 67 | If,EXISTFILE,%fullPath%,ShellExecute,OPEN,%fullPath% 68 | 69 | [Search-Drives] 70 | Set,%drive%,A 71 | StrFormat,Inc,%drive%,#c 72 | Echo,"Searching drive [%drive%:\]" 73 | Set,%fullPath%,%drive%:\%searchFile% 74 | If,EXISTFILE,%fullPath%,Loop,BREAK 75 | ``` -------------------------------------------------------------------------------- /Commands/String/IntToBytes.md: -------------------------------------------------------------------------------- 1 | # StrFormat,IntToBytes 2 | 3 | **Alias**: `StrFormat,Bytes` 4 | 5 | Converts a number of bytes to a more human readable format. 6 | 7 | Any amount of bytes specified will be converted to a string representing the size in KB, MB, GB, TB or PB. 8 | 9 | ## Syntax 10 | 11 | ```pebakery 12 | StrFormat,IntToBytes,,<%DestVar%> 13 | ``` 14 | 15 | ### Arguments 16 | 17 | | Argument | Description | 18 | | --- | --- | 19 | | Bytes | Bytes to format. | 20 | | DestVar | Variable where the resulting string will be stored. | 21 | 22 | ## Alternate Syntax 23 | 24 | Backwards compatible with Winbuilder's `StrFormat,Bytes` command 25 | 26 | ```pebakery 27 | StrFormat,Bytes, 28 | ``` 29 | 30 | _`StrFormat,IntToBytes,` can also be used, but is not compatible with Winbuilder._ 31 | 32 | ### Arguments 33 | 34 | | Argument | Description | 35 | | --- | --- | 36 | | SrcDestVar | Variable containing the bytes to convert. The resulting string will overwrite the contents of this variable. | 37 | 38 | ## Remarks 39 | 40 | PEBakery commands such as `DirSize`, `FileSize`, and `System,GetFreeSpace` return the size in bytes. This function is useful for converting the size in bytes to a more human readable format. 41 | 42 | The operation can be reversed using the `StrFormat,BytesToInt` command. 43 | 44 | ## Related 45 | 46 | [DirSize](../File/DirSize.md), [FileSize](../File/FileSize.md), [StrFormat, BytesToInt](./BytesToInt.md), [System,GetFreeSpace](../System/GetFreeSpace.md) 47 | 48 | ## Examples 49 | 50 | ### Example 1 51 | 52 | In this example we get the size of a directory using `DirSize` and convert the result to a more readable format. 53 | 54 | ```pebakery 55 | [Main] 56 | Title=IntToBytes 57 | Description=Show the usage of StrFormat,IntToBytes. 58 | Level=5 59 | Version=1 60 | Author=Homes32 61 | 62 | [Variables] 63 | %Dir%=C:\Windows\System32 64 | 65 | [process] 66 | DirSize,%Dir%,%Size% 67 | // Use StrFormat to convert the size to a more human readable format. 68 | StrFormat,IntToBytes,%Size%,%StrSize% 69 | Message,"Dir Size: %Size% bytes (%StrSize%)" 70 | ``` -------------------------------------------------------------------------------- /Commands/String/LCase.md: -------------------------------------------------------------------------------- 1 | # StrFormat,LCase 2 | 3 | Converts a string to lowercase. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,LCase,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | DestVar | The variable where the result will be saved. | 17 | 18 | ## Remarks 19 | 20 | None. 21 | 22 | ## Related 23 | 24 | [StrFormat,Left](./Left.md), [StrFormat,Right](./Right.md), [StrFormat,Len](./Len.md), [StrFormat,Mid](./Mid.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,UCase](./UCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,PosX](./PosX.md), [StrFormat,Replace](./Replace.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 25 | 26 | ## Examples 27 | 28 | ### Example 1 29 | 30 | ```pebakery 31 | [Main] 32 | Title=StrFormat-LCase Example 33 | Description=Demonstrate usage of StrFormat,LCase. 34 | Level=5 35 | Version=1 36 | Author=Homes32 37 | 38 | [variables] 39 | %string%="The Quick BROWN FOX Jumps Over The LAZY DOG." 40 | 41 | [process] 42 | StrFormat,LCase,%string%,%result% 43 | Message,"Lowercase string is: %result%" 44 | ``` -------------------------------------------------------------------------------- /Commands/String/LTrim.md: -------------------------------------------------------------------------------- 1 | # StrFormat,LTrim 2 | 3 | Removes a number of characters from the left-hand side of a string. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,LTrim,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | Count | The number of characters to remove. | 17 | | DestVar | The variable where the result will be saved. | 18 | 19 | ## Remarks 20 | 21 | If `Count` exceeds the string length an empty string is returned. 22 | 23 | ## Related 24 | 25 | [StrFormat,Left](./Left.md), [StrFormat,Right](./Right.md), [StrFormat,Len](./Len.md), [StrFormat,Mid](./Mid.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,UCase](./UCase.md), [StrFormat,LCase](./LCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,PosX](./PosX.md), [StrFormat,Replace](./Replace.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=StrFormat-LTrim Example 34 | Description=Demonstrate usage of StrFormat,LTrim. 35 | Level=5 36 | Version=1 37 | Author=Homes32 38 | 39 | [variables] 40 | %string%="The quick brown fox jumps over the lazy dog." 41 | %count%=19 42 | 43 | [process] 44 | StrFormat,LTrim,%string%,%count%,%result% 45 | Message,"After removing %count% characters from the left, the remaining string is: %result%" 46 | ``` -------------------------------------------------------------------------------- /Commands/String/Left.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Left 2 | 3 | Returns a number of characters from the left-hand side of a string. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,Left,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | Count | The number of characters to return. | 17 | | DestVar | The variable where the result will be saved. | 18 | 19 | ## Remarks 20 | 21 | `Integer` must be a positive value. 22 | 23 | If `Count` exceeds the string length then the entire string is returned. 24 | 25 | ## Related 26 | 27 | [StrFormat,Right](./Right.md), [StrFormat,Mid](./Mid.md), [StrFormat,Len](./Len.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,UCase](./UCase.md), [StrFormat,LCase](./LCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,PosX](./PosX.md), [StrFormat,Replace](./Replace.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 28 | 29 | ## Examples 30 | 31 | ### Example 1 32 | 33 | ```pebakery 34 | [Main] 35 | Title=StrFormat-Left Example 36 | Description=Demonstrate usage of StrFormat,Left. 37 | Level=5 38 | Version=1 39 | Author=Homes32 40 | 41 | [variables] 42 | %string%="The quick brown fox jumps over the lazy dog." 43 | %count%=19 44 | 45 | [process] 46 | StrFormat,Left,%string%,%count%,%result% 47 | Message,"The %count% leftmost characters are: %result%" 48 | ``` -------------------------------------------------------------------------------- /Commands/String/Len.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Len 2 | 3 | Returns the number of characters in a string. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,Len,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | DestVar | The variable where the result will be saved. | 17 | 18 | ## Remarks 19 | 20 | None. 21 | 22 | ## Related 23 | 24 | [StrFormat,Left](./Left.md), [StrFormat,Mid](./Mid.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,UCase](./UCase.md), [StrFormat,LCase](./LCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,PosX](./PosX.md), [StrFormat,Replace](./Replace.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 25 | 26 | ## Examples 27 | 28 | ### Example 1 29 | 30 | ```pebakery 31 | [Main] 32 | Title=StrFormat-Len Example 33 | Description=Demonstrate usage of StrFormat,Len. 34 | Level=5 35 | Version=1 36 | Author=Homes32 37 | 38 | [variables] 39 | %string%="The quick brown fox jumps over the lazy dog." 40 | 41 | [process] 42 | StrFormat,Len,%string%,%length% 43 | Message,"The number of characters is: %length%" 44 | ``` -------------------------------------------------------------------------------- /Commands/String/LongPath.md: -------------------------------------------------------------------------------- 1 | # StrFormat,LongPath 2 | 3 | Converts a `DOS 8.3` path to a long `NT` path. 4 | 5 | **This command has been deprecated and will be removed in a future release.** 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | StrFormat,LongPath,,<%DestVar%> 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | Path | The full path to convert. | 18 | | DestVar | The variable where the result will be saved. | 19 | 20 | ## Remarks 21 | 22 | Successful conversion to a long path depends on the registry value `HKLM\System\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation`, therefore this command cannot be guaranteed to work properly on every system. 23 | 24 | ## Related 25 | 26 | [StrFormat,ShortPath](./ShortPath.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=StrFormat-LongPath Example 35 | Description=Demonstrate usage of StrFormat,LongPath. 36 | Level=5 37 | Version=1 38 | Author=Homes32 39 | 40 | [variables] 41 | %path%="C:\Progra~2\Notepad++\Notepad++.exe" 42 | 43 | [process] 44 | StrFormat,LongPath,%path%,%result% 45 | Message,"LongPath: %result%" 46 | ``` -------------------------------------------------------------------------------- /Commands/String/Mid.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Mid 2 | 3 | Extracts a number of characters from a specific starting point in a string. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,Mid,,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | StartPos | The character position from the left to start reading. | 17 | | Count | The number of characters to return. | 18 | | DestVar | The variable where the result will be saved. | 19 | 20 | ## Remarks 21 | 22 | If `Count` exceeds the string length then the entire remainder of the string is returned. 23 | 24 | ## Related 25 | 26 | [StrFormat,Left](./Left.md), [StrFormat,Right](./Right.md), [StrFormat,Len](./Len.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,UCase](./UCase.md), [StrFormat,LCase](./LCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,PosX](./PosX.md), [StrFormat,Replace](./Replace.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=StrFormat-Mid Example 35 | Description=Demonstrate usage of StrFormat,Mid. 36 | Level=5 37 | Version=1 38 | Author=Homes32 39 | 40 | [variables] 41 | %string%="The quick brown fox jumps over the lazy dog." 42 | %start%=21 43 | %count%=10 44 | 45 | [process] 46 | StrFormat,Mid,%string%,%start%,%count%,%result% 47 | Message,"The %count% characters starting from %start% are: %result%" 48 | ``` -------------------------------------------------------------------------------- /Commands/String/Mult.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Mult 2 | 3 | Multiplies two numbers. 4 | 5 | **This command has been deprecated and may be removed in a future release. It is recommended that you update your code to use `Math,Mul` as soon as possible to avoid breaking your script.** 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | StrFormat,Mult,<%DestVar%>, 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | DestVar | Variable containing the number to multiply. | 18 | | Integer | The number to multiply `DestVar` by. | 19 | 20 | ## Remarks 21 | 22 | The result of the operation will be written back into `%DestVar%`. 23 | 24 | ## Related 25 | 26 | [StrFormat,Div](./Div.md), [Math,Div](../Math/Div.md), [Math,Mul](../Math/Mul.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=StrFormat-Mult Example 35 | Description=Show usage of the StrFormat,Mult Command 36 | Author=Homes32 37 | Level=5 38 | 39 | [Variables] 40 | %int%=20 41 | 42 | [Process] 43 | StrFormat,Mult,%int%,10 44 | Message,"20 * 10 = %int%" 45 | ``` -------------------------------------------------------------------------------- /Commands/String/NTrim.md: -------------------------------------------------------------------------------- 1 | # StrFormat,NTrim 2 | 3 | Removes any and all numbers from the end of a string. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,NTrim,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | DestVar | The variable where the result will be saved. | 17 | 18 | ## Remarks 19 | 20 | If no numbers exist at the end of the string it will not be modified. 21 | 22 | ## Related 23 | 24 | [StrFormat,Left](./Left.md), [StrFormat,Right](./Right.md), [StrFormat,Len](./Len.md), [StrFormat,Mid](./Mid.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,UCase](./UCase.md), [StrFormat,LCase](./LCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,PosX](./PosX.md), [StrFormat,Replace](./Replace.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 25 | 26 | ## Examples 27 | 28 | ### Example 1 29 | 30 | ```pebakery 31 | [Main] 32 | Title=StrFormat-NTrim Example 33 | Description=Demonstrate usage of StrFormat,NTrim. 34 | Level=5 35 | Version=1 36 | Author=Homes32 37 | 38 | [variables] 39 | %string%="ABCDEFG12345678" 40 | 41 | [process] 42 | StrFormat,NTrim,%string%,%result% 43 | Message,"After removing numbers from the end the remaining string is: %result%" 44 | ``` -------------------------------------------------------------------------------- /Commands/String/PadLeft.md: -------------------------------------------------------------------------------- 1 | # StrFormat,PadLeft 2 | 3 | Right-aligns the characters in a string by padding them with a specified character on the left, up to a specified total length. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,PadLeft,,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to align/pad. | 16 | | Count | The number of characters to expand the resulting string with padding. | 17 | | PadChar | Character to use for padding. | 18 | | DestVar | The variable where the result will be saved. | 19 | 20 | ## Remarks 21 | 22 | If the `String` length exceeds the number of characters defined by `Count` no padding will be applied. 23 | 24 | ## Related 25 | 26 | [StrFormat,PadRight](./PadRight.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=StrFormat-LeftPad Example 35 | Description=Pad the left hand side of a string with 0's up to 7 characters. 36 | Level=5 37 | Version=1 38 | Author=Homes32 39 | 40 | [Variables] 41 | %myString%=32 42 | 43 | [Process] 44 | StrFormat,PadLeft,%myString%,7,0,%Dest% 45 | Message,%Dest% 46 | ``` -------------------------------------------------------------------------------- /Commands/String/PadRight.md: -------------------------------------------------------------------------------- 1 | # StrFormat,PadRight 2 | 3 | Left-aligns the characters in a string by padding them with a specified character on the right, up to a specified total length. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,PadRight,,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to align/pad. | 16 | | Count | The number of characters to expand the resulting string with padding. | 17 | | PadChar | Character to use for padding. | 18 | | DestVar | The variable where the result will be saved. | 19 | 20 | ## Remarks 21 | 22 | If the `String` length exceeds the number of characters defined by `Count` no padding will be applied. 23 | 24 | ## Related 25 | 26 | [StrFormat,PadLeft](./PadLeft.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=StrFormat-RightPad Example 35 | Description=Pad the right hand side of a string with 0's up to 7 characters. 36 | Level=5 37 | Version=1 38 | Author=Homes32 39 | 40 | [Variables] 41 | %myString%=32 42 | 43 | [Process] 44 | StrFormat,PadRight,%myString%,7,0,%Dest% 45 | Message,%Dest% 46 | ``` -------------------------------------------------------------------------------- /Commands/String/PathCombine.md: -------------------------------------------------------------------------------- 1 | # StrFormat,PathCombine 2 | 3 | Combines a path with a filename to form a full path. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,PathCombine,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DirPath | The path of the file. | 16 | | FileName | The name and extension of the file. | 17 | | DestVar | Variable where the result will be stored. | 18 | 19 | ## Remarks 20 | 21 | PEBakery will add a trailing `\` to `DirPath` if it does not exist. 22 | 23 | ## Related 24 | 25 | [StrFormat,DirPath](./DirPath.md), [StrFormat,Ext](./Ext.md), [StrFormat,FileName](./FileName.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=StrFormat-PathCombine 34 | Description=Show usage of the StrFormat,PathCombine Command 35 | Author=Homes32 36 | Level=5 37 | Version=1 38 | 39 | [Variables] 40 | %File%=HAL.DLL 41 | %Path%=C:\Windows\System32\ 42 | 43 | [Process] 44 | StrFormat,PathCombine,%Path%,%File%,%result% 45 | Message,"Combined Path: %result%" 46 | ``` -------------------------------------------------------------------------------- /Commands/String/Pos.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Pos 2 | 3 | Returns the position of the given SubString inside the specified String. **Case Insensitive.** 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,Pos,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | SubString | The string to find within `String`. | 17 | | DestVar | The variable where the result will be saved. | 18 | 19 | ## Remarks 20 | 21 | If the `SubString` is not found the `%DestVar%` will return zero. 22 | 23 | If multiple occurrences of `SubString` exist within the string only the first occurrence will be returned. 24 | 25 | ## Related 26 | 27 | [StrFormat,Left](./Left.md), [StrFormat,Right](./Right.md), [StrFormat,Len](./Len.md), [StrFormat,Mid](./Mid.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,LCase](./LCase.md), [StrFormat,UCase](./UCase.md), [StrFormat,PosX](./PosX.md), [StrFormat,Replace](./Replace.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 28 | 29 | ## Examples 30 | 31 | ### Example 1 32 | 33 | ```pebakery 34 | [Main] 35 | Title=StrFormat-Pos Example 36 | Description=Demonstrate usage of StrFormat,Pos. 37 | Level=5 38 | Version=1 39 | Author=Homes32 40 | 41 | [variables] 42 | %string%="The quick brown fox jumps over the lazy dog." 43 | %subStr%="fox" 44 | 45 | [process] 46 | StrFormat,Pos,%string%,%subStr%,%result% 47 | Message,"Substring [%subStr%] is at position: %result%" 48 | ``` -------------------------------------------------------------------------------- /Commands/String/PosX.md: -------------------------------------------------------------------------------- 1 | # StrFormat,PosX 2 | 3 | Returns the position of the given SubString inside the specified String. **Case Sensitive.** 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,PosX,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | SubString | The string to find within `String`. | 17 | | DestVar | The variable where the result will be saved. | 18 | 19 | ## Remarks 20 | 21 | If the `SubString` is not found the `%DestVar%` will return zero. 22 | 23 | If multiple occurrences of `SubString` exist within the string only the first occurrence will be returned. 24 | 25 | ## Related 26 | 27 | [StrFormat,Left](./Left.md), [StrFormat,Right](./Right.md), [StrFormat,Len](./Len.md), [StrFormat,Mid](./Mid.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,LCase](./LCase.md), [StrFormat,UCase](./UCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,Replace](./Replace.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 28 | 29 | ## Examples 30 | 31 | ### Example 1 32 | 33 | ```pebakery 34 | [Main] 35 | Title=StrFormat-PosX Example 36 | Description=Demonstrate usage of StrFormat,PosX. 37 | Level=5 38 | Version=1 39 | Author=Homes32 40 | 41 | [variables] 42 | %string%="The quick brown fox jumps over the lazy dog." 43 | %subStr%="Fox" 44 | 45 | [process] 46 | StrFormat,PosX,%string%,%subStr%,%result% 47 | Message,"Substring [%subStr%] is at position: %result%" 48 | ``` -------------------------------------------------------------------------------- /Commands/String/RTrim.md: -------------------------------------------------------------------------------- 1 | # StrFormat,RTrim 2 | 3 | Removes a number of characters from the right-hand side of a string. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,RTrim,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | Count | The number of characters to remove. | 17 | | DestVar | The variable where the result will be saved. | 18 | 19 | ## Remarks 20 | 21 | If `Count` exceeds the string length an empty string is returned. 22 | 23 | ## Related 24 | 25 | [StrFormat,Left](./Left.md), [StrFormat,Right](./Right.md), [StrFormat,Len](./Len.md), [StrFormat,Mid](./Mid.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,UCase](./UCase.md), [StrFormat,LCase](./LCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,PosX](./PosX.md), [StrFormat,Replace](./Replace.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=StrFormat-RTrim Example 34 | Description=Demonstrate usage of StrFormat,RTrim. 35 | Level=5 36 | Version=1 37 | Author=Homes32 38 | 39 | [variables] 40 | %string%="The quick brown fox jumps over the lazy dog." 41 | %count%=19 42 | 43 | [process] 44 | StrFormat,RTrim,%string%,%count%,%result% 45 | Message,"After removing %count% characters from the right, the remaining string is: %result%" 46 | ``` -------------------------------------------------------------------------------- /Commands/String/Replace.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Replace 2 | 3 | Replaces all occurrences of a substring within a string. **Case Insensitive.** 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,Replace,,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | SearchString | The string to find within `String`. | 17 | | ReplaceString | The replacement string. | 18 | | DestVar | The variable where the result will be saved. | 19 | 20 | ## Remarks 21 | 22 | If the `SubString` is not found `%DestVar%` will contain the unmodified source string. 23 | 24 | ## Related 25 | 26 | [StrFormat,Left](./Left.md), [StrFormat,Right](./Right.md), [StrFormat,Len](./Len.md), [StrFormat,Mid](./Mid.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,LCase](./LCase.md), [StrFormat,UCase](./UCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,PosX](./PosX.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=StrFormat-Replace Example 35 | Description=Demonstrate usage of StrFormat,Replace. 36 | Level=5 37 | Version=1 38 | Author=Homes32 39 | 40 | [variables] 41 | %string%="The quick brown fox jumps over the lazy brown dog." 42 | %search%="brown" 43 | %replace%="red" 44 | 45 | [process] 46 | StrFormat,Replace,%string%,%search%,%replace%,%result% 47 | Message,"Substring [%search%] was replaced by [%replace%]: %result%" 48 | ``` -------------------------------------------------------------------------------- /Commands/String/ReplaceX.md: -------------------------------------------------------------------------------- 1 | # StrFormat,ReplaceX 2 | 3 | Replaces all occurrences of a substring within a string. **Case Sensitive.** 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,ReplaceX,,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | SearchString | The string to find within `String`. | 17 | | ReplaceString | The replacement string. | 18 | | DestVar | The variable where the result will be saved. | 19 | 20 | ## Remarks 21 | 22 | If the `SubString` is not found `%DestVar%` will contain the unmodified source string. 23 | 24 | ## Related 25 | 26 | [StrFormat,Left](./Left.md), [StrFormat,Right](./Right.md), [StrFormat,Len](./Len.md), [StrFormat,Mid](./Mid.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,LCase](./LCase.md), [StrFormat,UCase](./UCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,PosX](./PosX.md), [StrFormat,Replace](./Replace.md), [StrFormat,Split](./Split.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=StrFormat-ReplaceX Example 35 | Description=Demonstrate usage of StrFormat,ReplaceX. 36 | Level=5 37 | Version=1 38 | Author=Homes32 39 | 40 | [variables] 41 | %string%="The quick Brown fox jumps over the lazy brown dog." 42 | %search%="brown" 43 | %replace%="red" 44 | 45 | [process] 46 | StrFormat,ReplaceX,%string%,%search%,%replace%,%result% 47 | Message,"Substring [%search%] was replaced by [%replace%]: %result%" 48 | ``` -------------------------------------------------------------------------------- /Commands/String/Right.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Right 2 | 3 | Returns a number of characters from the right-hand side of a string. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,Right,,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | Count | The number of characters to return. | 17 | | DestVar | The variable where the result will be saved. | 18 | 19 | ## Remarks 20 | 21 | `Integer` must be a positive value. 22 | 23 | If `Count` exceeds the string length then the entire string is returned. 24 | 25 | ## Related 26 | 27 | [StrFormat,Left](./Left.md), [StrFormat,Mid](./Mid.md), [StrFormat,Len](./Len.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,UCase](./UCase.md), [StrFormat,LCase](./LCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,PosX](./PosX.md), [StrFormat,Replace](./Replace.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 28 | 29 | ## Examples 30 | 31 | ### Example 1 32 | 33 | ```pebakery 34 | [Main] 35 | Title=StrFormat-Right Example 36 | Description=Demonstrate usage of StrFormat,Right. 37 | Level=5 38 | Version=1 39 | Author=Homes32 40 | 41 | [variables] 42 | %string%="The quick brown fox jumps over the lazy dog." 43 | %count%=19 44 | 45 | [process] 46 | StrFormat,Right,%string%,%count%,%result% 47 | Message,"The %count% rightmost characters are: %result%" 48 | ``` -------------------------------------------------------------------------------- /Commands/String/Round.md: -------------------------------------------------------------------------------- 1 | # StrFormat,Round 2 | 3 | Rounds a value to the nearest formatted "size" (KB/MB/GB/TB/PB). 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,Round,<%Integer%>, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Integer | Variable containing the number to round. | 16 | | RoundTo | Size to round to. Can be one of the following: | 17 | || - An positive integer representing the number of bytes to round to. | 18 | || K - Round to the Kilobyte | 19 | || M - Round to the Megabyte | 20 | || G - Round to the Gigabyte | 21 | || T - Round to the Terabyte | 22 | || P - Round to the Petabyte | 23 | 24 | ## Remarks 25 | 26 | The `Integer` variable is overwritten with the result of the `StrFormat,Round` operation. 27 | 28 | This command can be used in conjunction with `StrFormat,IntToBytes` to return at human readable size rounded to nearest integer. 29 | 30 | For mathematical Rounding operations use the `Math,Round` command. 31 | 32 | ## Related 33 | 34 | [Math,Ceil](../Math/Ceil.md), [Math,Floor](../Math/Floor.md), [Math,Round](../Math/Round.md), [StrFormat,Ceil](./Ceil.md), [StrFormat,Floor](./Floor.md), [StrFormat,IntToBytes](./IntToBytes.md) 35 | 36 | ## Examples 37 | 38 | ### Example 1 39 | 40 | In this example we get the size of a directory in bytes, then use `StrFormat,Floor` to round to the nearest Gigabyte and finally format our result with `StrFormat,IntToBytes`. 41 | 42 | ```pebakery 43 | [Main] 44 | Title=StrFormat-Round 45 | Description=Show the usage of StrFormat,Round. 46 | Level=5 47 | Version=1 48 | Author=Homes32 49 | 50 | [Variables] 51 | %Dir%=C:\Windows\System32 52 | 53 | [process] 54 | DirSize,%Dir%,%Bytes% 55 | // Lets see what our formatted size is before rounding 56 | StrFormat,IntToBytes,%Bytes%,%StrSize% 57 | // Round Bytes to the nearest Gigabyte 58 | StrFormat,Round,%Bytes%,g 59 | // Use StrFormat to convert the size to a more human readable format. 60 | StrFormat,IntToBytes,%Bytes%,%StrFloorSize% 61 | Message,"Bytes: [%Bytes%]#$xFormatted: [%StrSize%]#$xRound: [%StrFloorSize%]" 62 | ``` -------------------------------------------------------------------------------- /Commands/String/ShortPath.md: -------------------------------------------------------------------------------- 1 | # StrFormat,ShortPath 2 | 3 | Converts a path into `DOS 8.3` compatible format. 4 | 5 | **This command has been deprecated and will be removed in a future release.** 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | StrFormat,ShortPath,,<%DestVar%> 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | Path | The full path to convert. | 18 | | DestVar | The variable where the result will be saved. | 19 | 20 | ## Remarks 21 | 22 | Successful conversion to a short path depends on the registry value `HKLM\System\CurrentControlSet\Control\FileSystem\NtfsDisable8dot3NameCreation`, therefore this command cannot be guaranteed to work properly on every system. 23 | 24 | ## Related 25 | 26 | [StrFormat,LongPath](./LongPath.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=StrFormat-ShortPath Example 35 | Description=Demonstrate usage of StrFormat,ShortPath. 36 | Level=5 37 | Version=1 38 | Author=Homes32 39 | 40 | [variables] 41 | %path%="C:\Program Files (x86)\Notepad++\Notepad++.exe" 42 | 43 | [process] 44 | StrFormat,ShortPath,%path%,%result% 45 | Message,"ShortPath: %result%" 46 | ``` -------------------------------------------------------------------------------- /Commands/String/UCase.md: -------------------------------------------------------------------------------- 1 | # StrFormat,UCase 2 | 3 | Converts a string to uppercase. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | StrFormat,UCase,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | String | The string to read. | 16 | | DestVar | The variable where the result will be saved. | 17 | 18 | ## Remarks 19 | 20 | None. 21 | 22 | ## Related 23 | 24 | [StrFormat,Left](./Left.md), [StrFormat,Right](./Right.md), [StrFormat,Len](./Len.md), [StrFormat,Mid](./Mid.md), [StrFormat,RTrim](./RTrim.md), [StrFormat,LTrim](./LTrim.md), [StrFormat,CTrim](./CTrim.md), [StrFormat,NTrim](./NTrim.md), [StrFormat,LCase](./LCase.md), [StrFormat,Pos](./Pos.md), [StrFormat,PosX](./PosX.md), [StrFormat,Replace](./Replace.md), [StrFormat,ReplaceX](./ReplaceX.md), [StrFormat,Split](./Split.md) 25 | 26 | ## Examples 27 | 28 | ### Example 1 29 | 30 | ```pebakery 31 | [Main] 32 | Title=StrFormat-UCase Example 33 | Description=Demonstrate usage of StrFormat,UCase. 34 | Level=5 35 | Version=1 36 | Author=Homes32 37 | 38 | [variables] 39 | %string%="The quick brown fox jumps over the lazy dog." 40 | 41 | [process] 42 | StrFormat,UCase,%string%,%result% 43 | Message,"Uppercase string is: %result%" 44 | ``` -------------------------------------------------------------------------------- /Commands/System/EndLocal.md: -------------------------------------------------------------------------------- 1 | # System,EndLocal 2 | 3 | Ends localization of variables within a script. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | System,EndLocal 9 | ``` 10 | 11 | ### Arguments 12 | 13 | This command has no arguments. 14 | 15 | ### Return Values 16 | 17 | | Return Value | Description | 18 | | --- | --- | 19 | | #r | When `System,EndLocal` is called the contents of the isolated variables are discarded. The `#r` token is not affected by the constraints of `System,SetLocal` and can be used to return the value of an isolated variable to the main process. `#r` is volatile so if you need to preserve the return value copy it into a local variable. | 20 | 21 | ## Remarks 22 | 23 | This command is intended for use in "library" scripts containing collections of macros. Maintaining unique variables for many macros in a single script can be difficult because local variables are in the scope of the entire `%ScriptFile%`. By making use of the `System,SetLocal` and `System,EndLocal` commands to isolate variables to a narrower scope you can ensure that each section's variables are protected from unwanted modification. 24 | 25 | ## Related 26 | 27 | [System,SetLocal](./SetLocal.md) 28 | 29 | ## Examples 30 | 31 | ### Example 1 32 | 33 | ```pebakery 34 | [Main] 35 | Title=SetLocal/EndLocal Example 36 | Author=Homes32 37 | Description=Demonstrate usage of the System,SetLocal and System,EndLocal command. 38 | Version=1 39 | Level=5 40 | 41 | [Interface] 42 | 43 | [variables] 44 | 45 | [process] 46 | Set,%var%,"This value should never change!" 47 | Run,%ScriptFile%,mySection 48 | Echo,"Let's verify our var1 didn't change." 49 | Echo,"Var1 = %var%" 50 | Echo,"R = #r" 51 | 52 | [mySection] 53 | System,SETLOCAL 54 | // Thanks to System,SETLOCAL we can safely use %var% in [mySection] without changing the value of %var% in our [Process] section. 55 | Echo,"Our isolated copy of var1: %var%" 56 | // Lets change it! 57 | Set,%var%,"Hello World!" 58 | Set,#r,%var% 59 | System,ENDLOCAL 60 | ``` -------------------------------------------------------------------------------- /Commands/System/ErrorOff.md: -------------------------------------------------------------------------------- 1 | # System,ErrorOff 2 | 3 | Prevents a process from failing in the event an error occurs. 4 | 5 | Errors that would normally cause a command to fail will be ignored and processing will continue. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | System,ErrorOff[,Lines] 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | Lines | **(Optional)** - The number of succeeding lines on which errors will be ignored. The default is to ignore only the line immediately following the `System,ErrorOff` command.| 18 | 19 | ## Remarks 20 | 21 | This command allows you to override the default "Fail on Error" behavior of commands such as `FileCopy` `RegRead`. 22 | 23 | An error message will still be generated in the log, however it will have a `Muted` state. 24 | 25 | ## Related 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | [Main] 33 | Title=ErrorOff Example 34 | Author=Homes32 35 | Description=Demonstrate usage of the System,ErrorOff command. 36 | Version=1 37 | Level=5 38 | 39 | [Interface] 40 | 41 | [variables] 42 | 43 | [process] 44 | 45 | // Don't stop processing if myFile.exe can't be copied to our target directory. 46 | System,ERROROFF 47 | FileCopy,C:\Temp\myFile.exe,%TargetDir%\myFile.exe 48 | 49 | 50 | // Don't stop processing if the following registry values do not exist. 51 | System,ERROROFF,2 52 | RegRead,HKCR,Wow6432Node\Applications\vmware-mount.exe\shell\Mount\command,,%VMtmp% 53 | RegRead,HKLM,"CurrentControlSet\Services\Eventlog\Application\VMware Virtual Mount Service Extended",EventMessageFile,%VMtmp% 54 | ``` -------------------------------------------------------------------------------- /Commands/System/GetFreeDrive.md: -------------------------------------------------------------------------------- 1 | # System,GetFreeDrive 2 | 3 | Returns the highest available free drive letter, Usually the "Z:" drive. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | System,GetFreeDrive,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable where the drive letter will be stored. | 16 | 17 | ## Remarks 18 | 19 | ## Related 20 | 21 | ## Examples 22 | 23 | ### Example 1 24 | 25 | ```pebakery 26 | [main] 27 | Title=GetFreeDrive Example 28 | Description=Show usage of the System,GetFreeDrive command. 29 | Level=5 30 | Version=1 31 | Author=Homes32 32 | 33 | [variables] 34 | 35 | [process] 36 | System,GetFreeDrive,%driveLetter% 37 | Message,"The last available drive letter is: %driveLetter%" 38 | ``` -------------------------------------------------------------------------------- /Commands/System/GetFreeSpace.md: -------------------------------------------------------------------------------- 1 | # System,GetFreeSpace 2 | 3 | Returns the free disk space of a path in Megabytes. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | System,GetFreeSpace,,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Path | The full Path of drive or directory to receive information from. | 16 | | DestVar | The variable where the drive letter will be stored. | 17 | 18 | ## Remarks 19 | 20 | PEBakery calculates 1 Megabyte = 1024 Bytes. 21 | 22 | The free space size can be converted from megabytes to KB/GB/TB/PB using various `StrFormat` commands. 23 | 24 | ## Related 25 | 26 | [StrFormat,Ceil](../String/Ceil.md), [StrFormat,Floor](../String/Floor.md), [StrFormat,Round](../String/Round.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [main] 34 | Title=GetFreeSpace Example 35 | Description=Show usage of the System,GetFreeDrive command. 36 | Level=5 37 | Version=1 38 | Author=Homes32 39 | 40 | [variables] 41 | %RequiredFreeMB%=800 42 | 43 | [process] 44 | // Check to see if we have enough free space to build this project. 45 | System,GetFreeSpace,%TargetDir%,%varTarget% 46 | If,%varTarget%,SMALLER,%RequiredFreeMB%,Then,Halt,"You only have %varTarget% MB free space in your target directory. You need at least %RequiredFreeMB% MB free in order to build this project." 47 | ``` -------------------------------------------------------------------------------- /Commands/System/IsAdmin.md: -------------------------------------------------------------------------------- 1 | # System,IsAdmin 2 | 3 | Checks to see if PEBakery was started by an account with "Admin" privileges. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | System,IsAdmin,<%DestVar%> 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | DestVar | The variable will return one of the following values: | 16 | || True - PEBakery was started with "Admin" privileges. | 17 | || False - PEBakery was not started with "Admin" privileges. | 18 | 19 | ## Remarks 20 | 21 | This command is included for compatibility with Winbuilder 082. PEBakery always requires Administrator privileges to run. 22 | 23 | ## Related 24 | 25 | ## Examples 26 | 27 | ### Example 1 28 | 29 | ```pebakery 30 | [main] 31 | Title=IsAdmin Example 32 | Description=Show usage of the System,IsAdmin command. 33 | Level=5 34 | Version=1 35 | Author=Homes32 36 | 37 | [variables] 38 | 39 | [process] 40 | System,IsAdmin,%isAdmin% 41 | If,%isAdmin%,Equal,True,Message,"PEBakery is running as Admin." 42 | Else,Message,"PEBakery is NOT running as Admin." 43 | ``` -------------------------------------------------------------------------------- /Commands/Text/README.md: -------------------------------------------------------------------------------- 1 | # Text Commands 2 | 3 | These commands allow you to add and remove lines from plain-text files. 4 | 5 | Click on a Command name for a detailed description. 6 | 7 | | Command | Description | 8 | | --- | --- | 9 | | [TXTAddLine](./TXTAddLine.md) | Inserts a line of text at the specified location inside a file. | 10 | | [TXTDelEmptyLines](./TXTDelEmptyLines.md) | Removes all empty lines from a given text file. | 11 | | [TXTDelLine](./TXTDelLine.md) | Removes lines from a given text file that begin with a specific string. | 12 | | [TXTDelSpaces](./TXTDelSpaces.md) | Delete all spaces from the beginning of each line inside a text file. | 13 | | [TXTReplace](./TXTReplace.md) | Search inside a given file and replace all text that matches the value of OldString and replace it with NewString. | 14 | -------------------------------------------------------------------------------- /Commands/Text/TXTAddLine.md: -------------------------------------------------------------------------------- 1 | # TXTAddLine 2 | 3 | Inserts a line of text at the specified location inside a file. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | TXTAddLine,,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file. | 16 | | String | The text to be added. | 17 | | Action | Choose one of the following directives:| 18 | || **Prepend** - Will insert the line of text at the top of the file. | 19 | || **Append** - Will insert the line of text at the end of the file. 20 | 21 | ## Remarks 22 | 23 | If `FileName` does not exist it will be created using UTF-8 encoding. 24 | 25 | WinBuilder's implementation of TxtAddLine allowed for an `Action` called **Place** which would allow the developer to specify a line number where the text should be inserted. This feature was depreciated in PEBakery due to lack of perceived usefulness. 26 | 27 | PEBakery will optimize multiple `TXTAddLine` commands in a row into single write command. 28 | 29 | ## Related 30 | 31 | [TXTDelEmptyLines](./TXTDelEmptyLines.md), [TXTDelLine](./TXTDelLine.md), [TXTDelSpaces](./TXTDelSpaces.md), [TXTReplace](./TXTReplace.md) 32 | 33 | ## Examples 34 | 35 | ### Example 1 36 | 37 | In this example we add a line saying `Hello World!` to the end of the file. 38 | 39 | ```pebakery 40 | TXTAddLine,C:\myFile.txt,Hello World!,Append 41 | ``` 42 | -------------------------------------------------------------------------------- /Commands/Text/TXTDelEmptyLines.md: -------------------------------------------------------------------------------- 1 | # TXTDelEmptyLines 2 | 3 | Removes all empty lines from a given text file. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | TXTDelEmptyLines, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file. | 16 | 17 | ## Remarks 18 | 19 | This command was created to make some specific INI files smaller in overall size. 20 | 21 | If `FileName` does not exist the operation will fail. 22 | 23 | ## Related 24 | 25 | [TXTAddLine](./TXTAddLine.md), [TXTDelLine](./TXTDelLine.md), [TXTDelSpaces](./TXTDelSpaces.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | TxtDelEmptyLines,C:\myFile.txt 33 | ``` -------------------------------------------------------------------------------- /Commands/Text/TXTDelLine.md: -------------------------------------------------------------------------------- 1 | # TXTDelLine 2 | 3 | Removes lines from a given text file that begin with a specific string. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | TXTDelLine,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file. | 16 | | String | String of text used to mark the beginning of the line to be deleted. `String` is Case Sensitive. 17 | 18 | ## Remarks 19 | 20 | Caution should be exercised when using this command, as the value of `String` doesn't need to be the value of the entire line, it only need to match the beginning of the line. 21 | 22 | If `FileName` does not exist the operation will fail. 23 | 24 | PEBakery will optimize multiple `TXTDelLine` commands in a row into a single delete command. 25 | 26 | ## Related 27 | 28 | [TXTAddLine](./TXTAddLine.md), [TXTDelEmptyLines](./TXTDelEmptyLines.md), [TXTDelSpaces](./TXTDelSpaces.md) 29 | 30 | ## Examples 31 | 32 | ### Example 1 33 | 34 | Assume we have the following file: 35 | 36 | ```pebakery 37 | // C:\myFile.txt 38 | 1. Hello World! 39 | 2. HelloWorld! 40 | 3. This will be the only line remaining. 41 | ``` 42 | 43 | In this example all lines that begin with "Hello" inside C:\myFile.txt will be removed, leaving line 3 as the only remaining line in the file. 44 | 45 | ```pebakery 46 | TXTDelLine,C:\myFile.txt,"Hello" 47 | ``` -------------------------------------------------------------------------------- /Commands/Text/TXTDelSpaces.md: -------------------------------------------------------------------------------- 1 | # TXTDelSpaces 2 | 3 | Delete all spaces from the beginning and end of each line inside a text file. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | TXTDelSpaces, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file. | 16 | 17 | ## Remarks 18 | 19 | This command was created to make some specific INI files smaller in overall size. 20 | 21 | If `FileName` does not exist the operation will fail. 22 | 23 | ## Related 24 | 25 | [TXTAddLine](./TXTAddLine.md), [TXTDelEmptyLines](./TXTDelEmptyLines.md), [TXTDelLine](./TXTDelLine.md) 26 | 27 | ## Examples 28 | 29 | ### Example 1 30 | 31 | ```pebakery 32 | TxtDelSpaces,C:\myFile.txt 33 | ``` -------------------------------------------------------------------------------- /Commands/Text/TXTReplace.md: -------------------------------------------------------------------------------- 1 | # TXTReplace 2 | 3 | Search inside a given file and replace all text that matches the value of OldString and replace it with NewString. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | TXTReplace,,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | FileName | The full path of the file. | 16 | | OldString | String to be replaced in the file. `OldString` is **not** Case Sensitive. | 17 | | NewString | String that will replace `OldString`. | 18 | 19 | ## Remarks 20 | 21 | Caution should be exercised when using this command, as **any** instance of `OldString` will be replaced, even if it is part of another word. 22 | 23 | If `FileName` does not exist the operation will fail. 24 | 25 | PEBakery will optimize multiple `TXTReplace` in a row to single command. 26 | 27 | ## Related 28 | 29 | [TXTAddLine](./TXTAddLine.md), [TXTDelEmptyLines](./TXTDelEmptyLines.md), [TXTDelLine](./TXTDelLine.md), [TXTDelSpaces](./TXTDelSpaces.md) 30 | 31 | ## Examples 32 | 33 | ### Example 1 34 | 35 | Assume we have the following file: 36 | 37 | ```pebakery 38 | // C:\myFile.txt 39 | Hello World! 40 | HelloWorld! 41 | hello World! 42 | HelloGoodbyehellogoodbyeHelloGoodbye 43 | ``` 44 | 45 | In this example all instances of the word `Hello` inside C:\myFile.txt will be replaced with the word `Goodbye` 46 | 47 | ```pebakery 48 | TXTReplace,C:\myFile.txt,"Hello",Goodbye 49 | ``` 50 | 51 | Result: 52 | 53 | ```pebakery 54 | // C:\myFile.txt 55 | Goodbye World! 56 | GoodbyeWorld! 57 | Goodbye World! 58 | GoodbyeGoodbyeGoodbyegoodbyeGoodbyeGoodbye 59 | ``` -------------------------------------------------------------------------------- /Commands/WIM/README.md: -------------------------------------------------------------------------------- 1 | # WIM (Windows Image) Commands 2 | 3 | Commands for working with Windows Imaging (.wim) files. 4 | 5 | Click on a Command name for a detailed description. 6 | 7 | | Command | Description | 8 | | --- | --- | 9 | | [WimAppend](./WimAppend.md) | Adds an image to an existing Windows Imaging file. | 10 | | [WimApply](./WimApply.md) | Extracts ("applies") an image from a Windows Imaging file. | 11 | | [WimCapture](./WimCapture.md) | Creates a new Windows Imaging file. | 12 | | [WimDelete](./WimDelete.md) | Deletes an image from a Windows Imaging file. | 13 | | [WimExport](./WimExport.md) | Exports an image from a Windows Imaging file. | 14 | | [WimExtract](./WimExtract.md) | Extracts one or more files or directory trees from a Windows Imaging file. | 15 | | [WimExtractBulk](./WimExtractBulk.md) | Uses a "list file" to extract one or more files or directory trees from a Windows Imaging file. | 16 | | [WimInfo](./WimInfo.md) | Retrieves information about a Windows Imaging file. | 17 | | [WimMount](./WimMount.md) | Mounts an image in a Windows Imaging file to the specified directory. | 18 | | [WimOptimize](./WimOptimize.md) | Rebuilds a Windows Imaging file. | 19 | | [WimPathAdd](./WimPathAdd.md) | Add a file or directory tree to a Windows Imaging file. | 20 | | [WimPathDelete](./WimPathDelete.md) | Removes a file or directory tree from a Windows Imaging file. | 21 | | [WimPathRename](./WimPathRename.md) | Move or Rename a file or directory tree in a Windows Imaging file. | 22 | | [WimUnmount](./WimUnmount.md) | Unmounts a mounted image in a Windows Imaging file from the specified directory. | -------------------------------------------------------------------------------- /Commands/WIM/WimDelete.md: -------------------------------------------------------------------------------- 1 | # WimDelete 2 | 3 | Deletes an image from a Windows Imaging (.wim) file. 4 | 5 | `WimDelete` rebuilds the WIM with all unnecessary file data removed. This is different from Microsoft’s ImageX and DISM, which only will delete the directory tree metadata and XML data, leaving the file data intact. 6 | 7 | ## Syntax 8 | 9 | ```pebakery 10 | WimDelete,,[,CHECK] 11 | ``` 12 | 13 | ### Arguments 14 | 15 | | Argument | Description | 16 | | --- | --- | 17 | | WimFile | The full path to the .wim file. | 18 | | ImageIndex | The index of the image within the WIM file to delete. | 19 | 20 | ### Flags 21 | 22 | | Argument | Description | 23 | | --- | --- | 24 | | CHECK | **(Optional)** Before deleting an image from the WIM, verify it's integrity if it contains extra integrity information. Also include extra integrity information in the rebuilt WIM, even if it was not present before. | 25 | 26 | ## Remarks 27 | 28 | It is possible to delete all the images from a WIM and have a WIM with 0 images, although such a file may not be very useful. 29 | 30 | **Data integrity:** In order to detect accidental (non-malicious) data corruption, the checksum of every file extracted is calculated and an error is returned if it does not match the checksum included in the WIM file. In addition, a WIM file can include an integrity table (extra checksums) over the raw data of the entire WIM file. For performance reasons PEBakery does not verify or create the integrity table by default, but the `CHECK` flag can be specified to make it do so. 31 | 32 | **Split WIMs:** PEBakery does not support deleting images from split WIM files (.swm). 33 | 34 | This command uses the the open source [Windows Imaging library (wimlib)](https://wimlib.net/). 35 | 36 | ## Related 37 | 38 | [WimMount](./WimMount.md), [WimUnmount](./WimUnmount.md), [WimAppend](./WimAppend.md), [WimInfo](./WimInfo.md), [WimPathDelete](./WimPathDelete.md) 39 | 40 | ## Examples 41 | 42 | ### Example 1 43 | 44 | In this example we will remove the 1st image (index 1) in a WIM file. 45 | 46 | ```pebakery 47 | WimDelete,C:\Temp\Boot.wim,1 48 | ``` -------------------------------------------------------------------------------- /Commands/WIM/WimUnmount.md: -------------------------------------------------------------------------------- 1 | # WimUnmount 2 | 3 | Unmounts a mounted image in a Windows Imaging File (.WIM) from the specified directory. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | WimUnmount,, 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | MountDir | The full path of the directory where the .wim file is mounted. If the directory does not exist or there is no image mounted the operation will fail. | 16 | | UnmountOption | Must be one of the following: | 17 | || COMMIT - Save changes made to the image. | 18 | || DISCARD - Discard any changes. The image will not be modified. | 19 | 20 | ## Remarks 21 | 22 | If you mounted the image as `READWRITE` the image will not be modified unless the `COMMIT` directive is also specified in the `WimUnmount` command. 23 | 24 | This command uses the `wimgapi.dll` library included with Microsoft Windows. 25 | 26 | ## Related 27 | 28 | [WimMount](./WimMount.md) 29 | 30 | ## Examples 31 | 32 | Unmount the install.wim image mounted to our *%BaseDir%\Mount\InstallWim* folder. 33 | 34 | ### Example 1 35 | 36 | ```pebakery 37 | [Main] 38 | Title=WimUnmount Example 39 | Description=Show usage of the WimUnmount command. 40 | Author=Homes32 41 | Level=5 42 | Version=1 43 | 44 | [Variables] 45 | %InstallWim%=C:\W10\x64\sources\install.wim 46 | %WimIndex%=4 47 | %MountDir%=C:\PEBakery\Mount\Win10PESE\Source\InstallWimSrc 48 | 49 | [Process] 50 | // the directory %MountDir% must exist or the mount operation will fail. 51 | If,Not,EXISTDIR,%MountDir%,DirMake,%MountDir% 52 | Echo,"Mounting Install.wim from#$x--> %InstallWim% [Index: %WimIndex%]" 53 | // Mount the image with index 4 54 | WimMount,%InstallWim%,%WimIndex%,%MountDir%,READWRITE 55 | Echo,"This is where you would copy some files, etc..." 56 | Wait,10 57 | // Commit our changes and unmount the image... 58 | Echo,"UnMounting %MountDir%..." 59 | WimUnmount,%MountDir%,COMMIT 60 | ``` -------------------------------------------------------------------------------- /GUIControls/Bevel.md: -------------------------------------------------------------------------------- 1 | # Bevel Control 2 | 3 | A rectangular frame used to organize controls. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | =,,12,,,,[,][,][,][,] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Name | Unique name used to reference this control. | 16 | | Caption | Label displayed on the top of the bevel. Use `""` for none. | 17 | | Visibility | `True`/`False` - Show or Hide the control. | 18 | | ControlID | `12` - The control ID specifying that this is a Bevel. | 19 | | PosX | Horizontal Position measured from the control's top left corner. | 20 | | PosY | Vertical Position measured from the control's top left corner. | 21 | | Width | Width of the control. | 22 | | Height | Height of the control. | 23 | | Font Size | **(Optional)** Font Size in points. (ex. 12) | 24 | | Font Weight | **(Optional)** Can be `Normal`, `Bold`. | 25 | | Font Style | **(Optional)** Can be `Italic`, `Underline`, `Strike`. | 26 | | ToolTip | **(Optional)** Help Text that will be shown when the user hovers over the control. This argument must always begin with a double underscore `__`. *Example:* `"__Some useful info"` | 27 | 28 | ## Remarks 29 | 30 | In order for the `Caption` to be displayed, a `Font Size` must be specified. 31 | 32 | ## Related 33 | 34 | [ReadInterface](../Commands/Interface/ReadInterface.md), [WriteInterface](../Commands/Interface/WriteInterface.md) 35 | 36 | ## Examples 37 | 38 | ```pebakery 39 | // Bevel with no caption (no Font Size specified) 40 | Bevel1=Bevel1,1,12,128,8,414,287 41 | Bevel2="",1,12,250,109,184,62 42 | 43 | // Bevel with caption 44 | Bevel3="Hello World!",1,12,250,19,104,82,10 45 | 46 | // Bevel with 10pt font and Bold caption 47 | Bevel4="Settings",1,12,135,239,400,50,10,Bold 48 | ``` -------------------------------------------------------------------------------- /GUIControls/CheckBox.md: -------------------------------------------------------------------------------- 1 | # Check Box Control 2 | 3 | A box that can be “checked” or “unchecked”. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | =,,3,,,,,[,,][,] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Name | Unique name used to reference this control. | 16 | | Caption | Label displayed next to the check box. Use `""` for none. | 17 | | Visibility | `True`/`False` - Show or Hide the control. | 18 | | ControlID | `3` - The control ID specifying that this is a Check Box. | 19 | | PosX | Horizontal Position measured from the control's top left corner. | 20 | | PosY | Vertical Position measured from the control's top left corner. | 21 | | Width | Width of the control. | 22 | | Height | Height of the control. | 23 | | Value | True/False - Checked `True` Unchecked `False` | 24 | | SectionToRun | **(Optional)** Defines the [Section] within the script that will be processed when the button is pressed or the value of the control is changed. The section name must be enclosed in underscore `_` characters. *Example:* `_RunMe_` | 25 | | ShowProgress | **(Optional)** True/False - Show the Build progress screen while `SectionToRun` is being executed. This argument must always follow the `SectionToRun` argument. | 26 | | ToolTip | **(Optional)** Help Text that will be shown when the user hovers over the control. This argument must always begin with a double underscore `__`. *Example:* `"__Some useful info"` | 27 | 28 | ## Remarks 29 | 30 | The `Value` of the check box can be read by referencing the control `Name` as a variable. Ex. `%CheckBox1%` or by using the `ReadInterface` command. 31 | 32 | ## Related 33 | 34 | [ReadInterface](../Commands/Interface/ReadInterface.md), [WriteInterface](../Commands/Interface/WriteInterface.md) 35 | 36 | ## Examples 37 | 38 | ```pebakery 39 | // Checkbox in the "unchecked" (False) state 40 | CheckBox1=CheckBox,1,3,137,110,104,20,False 41 | ``` -------------------------------------------------------------------------------- /GUIControls/NumberBox.md: -------------------------------------------------------------------------------- 1 | # Number Box Control 2 | 3 | An input box that accepts a number between a given minimum and maximum range. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | =,,2,,,,,,,,[,] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Name | Unique name used to reference this control. | 16 | | Visibility | `True`/`False` - Show or Hide the control. | 17 | | ControlID | `2` - The control ID specifying that this is a Number Box. | 18 | | PosX | Horizontal Position measured from the control's top left corner. | 19 | | PosY | Vertical Position measured from the control's top left corner. | 20 | | Width | Width of the control. | 21 | | Height | Height of the control. | 22 | | Min | The minimum value the number box will allow. | 23 | | Max | The maximum value the number box will allow. | 24 | | Increment | Clicking the up/down arrows on the number box will increase the value by a factor of *n*. | 25 | | ToolTip | **(Optional)** Help Text that will be shown when the user hovers over the control. This argument must always begin with a double underscore `__`. *Example:* `"__Some useful info"` | 26 | 27 | ## Remarks 28 | 29 | The `Value` of the number box can be read by referencing the control `Name` as a variable. Ex. `%NumberBox1%` or by using the `ReadInterface` command. 30 | 31 | ## Related 32 | 33 | [ReadInterface](../Commands/Interface/ReadInterface.md), [WriteInterface](../Commands/Interface/WriteInterface.md) 34 | 35 | ## Examples 36 | 37 | ```pebakery 38 | NumberBox1=pNumberBox1,1,2,473,31,56,22,0,0,256,1,"__Increment positive number by a factor of 1" 39 | NumberBox2=pNumberBox2,1,2,473,60,55,22,0,-256,256,2,"__Increment or decrement number by a factor of 2" 40 | ``` -------------------------------------------------------------------------------- /GUIControls/RadioButton.md: -------------------------------------------------------------------------------- 1 | # Radio Button Control 2 | 3 | A circular button that can have only one radio button selected on the interface at a time. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | =,,11,,,,,[,,][,] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Name | Unique name used to reference this control. | 16 | | Caption | Label displayed next to the radio button. Use `""` for none. | 17 | | Visibility | `True`/`False` - Show or Hide the control. | 18 | | ControlID | `11` - The control ID specifying that this is a Radio Button. | 19 | | PosX | Horizontal Position measured from the control's top left corner. | 20 | | PosY | Vertical Position measured from the control's top left corner. | 21 | | Width | Width of the control. | 22 | | Height | Height of the control. | 23 | | Value | True/False - Selected `True` Deselected `False` | 24 | | SectionToRun | **(Optional)** Defines the [Section] within the script that will be processed when the button is pressed or the value of the control is changed. The section name must be enclosed in underscore `_` characters. *Example:* `_RunMe_` | 25 | | ShowProgress | **(Optional)** True/False - Show the Build progress screen while `SectionToRun` is being executed. This argument must always follow the `SectionToRun` argument. | 26 | | ToolTip | **(Optional)** Help Text that will be shown when the user hovers over the control. This argument must always begin with a double underscore `__`. *Example:* `"__Some useful info"` | 27 | 28 | ## Remarks 29 | 30 | The `Value` of the radio button can be read by referencing the control `Name` as a variable. Ex. `%RadioButton1%` or by using the `ReadInterface` command. 31 | 32 | ## Related 33 | 34 | [ReadInterface](../Commands/Interface/ReadInterface.md), [WriteInterface](../Commands/Interface/WriteInterface.md) 35 | 36 | ## Examples 37 | 38 | ```pebakery 39 | RadioButton1=RadioButton1,1,11,324,124,100,20,True 40 | RadioButton2=RadioButton2,1,11,324,144,100,20,False 41 | RadioButton3=RadioButton3,1,11,324,164,100,20,False 42 | ``` -------------------------------------------------------------------------------- /GUIControls/TextBox.md: -------------------------------------------------------------------------------- 1 | # Text Box Control 2 | 3 | An input box that accepts a single line of text. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | =,,0,,,,,[,] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Name | Unique name used to reference this control. | 16 | | Caption | The Label displayed over the text box. Use `""` for none. | 17 | | Visibility | `True`/`False` - Show or Hide the control. | 18 | | ControlID | `0` - The control ID specifying that this is a Text Box. | 19 | | PosX | Horizontal Position measured from the control's top left corner. | 20 | | PosY | Vertical Position measured from the control's top left corner. | 21 | | Width | Width of the control. | 22 | | Height | Height of the control. | 23 | | Value | The value of the text box. | 24 | | ToolTip | **(Optional)** Help Text that will be shown when the user hovers over the control. This argument must always begin with a double underscore `__`. *Example:* `"__Some useful info"` | 25 | 26 | ## Remarks 27 | 28 | The `Value` of the text box can be read by referencing the control `Name` as a variable. Ex. `%TextBox1%` or by using the `ReadInterface` command. 29 | 30 | ## Related 31 | 32 | [ReadInterface](../Commands/Interface/ReadInterface.md), [WriteInterface](../Commands/Interface/WriteInterface.md) 33 | 34 | ## Examples 35 | 36 | ```pebakery 37 | TextBox1=TextBox,1,0,138,179,171,21,"abc.." 38 | ``` -------------------------------------------------------------------------------- /GUIControls/TextFile.md: -------------------------------------------------------------------------------- 1 | # Text File Control 2 | 3 | Displays a text file embedded within the script. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | =,,6,,,,[,] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Name | Unique name used to reference this control. | 16 | | FileName | The name of the encoded file to display. | 17 | | Visibility | `True`/`False` - Show or Hide the control. | 18 | | ControlID | `6` - The control ID specifying that this is a Text File. | 19 | | PosX | Horizontal Position measured from the control's top left corner. | 20 | | PosY | Vertical Position measured from the control's top left corner. | 21 | | Width | Width of the control. | 22 | | Height | Height of the control. | 23 | | ToolTip | **(Optional)** Help Text that will be shown when the user hovers over the control. This argument must always begin with a double underscore `__`. *Example:* `"__Some useful info"` | 24 | 25 | ## Supported File Types 26 | 27 | The TextFile control is capable of displaying rich text and plain text. 28 | 29 | Supported file types are: 30 | 31 | TXT, RTF 32 | 33 | Text based files with alternate file extensions (ex. CFG, CONF, INI, INF, LOG, SCRIPT) are also supported. 34 | 35 | ## Remarks 36 | 37 | Text files are encoded and embedded in the script's `InterfaceEncoded` folder. 38 | 39 | ## Related 40 | 41 | [ReadInterface](../Commands/Interface/ReadInterface.md), [WriteInterface](../Commands/Interface/WriteInterface.md) 42 | 43 | ## Examples 44 | 45 | ```pebakery 46 | [Interface] 47 | TextFile1=TextFile.txt,1,6,135,209,175,76 48 | 49 | [InterfaceEncoded] 50 | TextFile.txt=99,132 51 | 52 | [EncodedFile-InterfaceEncoded-TextFile.txt] 53 | lines=0 54 | 0=eJzzSM3JyVcIzy/KSVHk5fIgiwcA61sVjnic4wlJrShxy8xJ1SupKGEYBSMNuEBpSRzyN1W/mTEwAQAtYwdJj9s6pwEAAAACAAAAJgAAABkAAAAAAAAAAQAAAAAAAAAAAAAA 55 | ``` -------------------------------------------------------------------------------- /GUIControls/TextLabel.md: -------------------------------------------------------------------------------- 1 | # Text Label Control 2 | 3 | Displays a line of text. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | =,,1,,,,,,[,][,] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Name | Unique name used to reference this control. | 16 | | Caption | Text displayed on the control. | 17 | | Visibility | `True`/`False` - Show or Hide the control. | 18 | | ControlID | `1` - The control ID specifying that this is a Text Label. | 19 | | PosX | Horizontal Position measured from the control's top left corner. | 20 | | PosY | Vertical Position measured from the control's top left corner. | 21 | | Width | Width of the control. | 22 | | Height | Height of the control. | 23 | | Font Size | Font Size in points. (ex. 12) | 24 | | Font Weight | Can be `Normal`, `Bold`. | 25 | | Font Style | **(Optional)** Can be `Italic`, `Underline`, `Strike`. | 26 | | ToolTip | **(Optional)** Help Text that will be shown when the user hovers over the control. This argument must always begin with a double underscore `__`. *Example:* `"__Some useful info"` | 27 | 28 | ## Remarks 29 | 30 | Text labels will wrap text, allowing multiple lines to be displayed within the `Width` and `Height` boundary of the Text Label. 31 | 32 | ## Related 33 | 34 | [ReadInterface](../Commands/Interface/ReadInterface.md), [WriteInterface](../Commands/Interface/WriteInterface.md) 35 | 36 | ## Examples 37 | 38 | ```pebakery 39 | pTextLabel1="Hello World!",1,1,20,50,230,18,8,Normal 40 | pTextLabel2="Goodbye World!",1,1,20,100,230,18,8,Bold,Underline 41 | ``` -------------------------------------------------------------------------------- /GUIControls/WebLabel.md: -------------------------------------------------------------------------------- 1 | # Web Label Control 2 | 3 | A hyperlink that will open a webpage in the default browser. 4 | 5 | ## Syntax 6 | 7 | ```pebakery 8 | =,,10,,,,,[,] 9 | ``` 10 | 11 | ### Arguments 12 | 13 | | Argument | Description | 14 | | --- | --- | 15 | | Name | Unique name used to reference this control. | 16 | | Caption | Text displayed on the control. | 17 | | Visibility | `True`/`False` - Show or Hide the control. | 18 | | ControlID | `10` - The control ID specifying that this is a Web Label. | 19 | | PosX | Horizontal Position measured from the control's top left corner. | 20 | | PosY | Vertical Position measured from the control's top left corner. | 21 | | Width | Width of the control. | 22 | | Height | Height of the control. | 23 | | URL | The website to launch if the hyperlink is clicked. | 24 | | ToolTip | **(Optional)** Help Text that will be shown when the user hovers over the control. This argument must always begin with a double underscore `__`. *Example:* `"__Some useful info"` | 25 | 26 | ## Remarks 27 | 28 | PEBakery will always display the first 47 characters of the `URL` in the `ToolTip`. 29 | 30 | ## Related 31 | 32 | [ReadInterface](../Commands/Interface/ReadInterface.md), [WriteInterface](../Commands/Interface/WriteInterface.md) 33 | 34 | ## Examples 35 | 36 | ```pebakery 37 | // WebLabel 38 | pWebLabel1=GitHub,1,10,250,160,32,18,https://github.com/ 39 | // WebLabel with ToolTip 40 | pWebLabel1=GitHub,1,10,250,260,32,18,https://github.com/v/PEBakery"__Contribute to PEBakery's development." 41 | ``` -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | CC BY 4.0 2 | 3 | This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/. 4 | -------------------------------------------------------------------------------- /LangRef/Comments.md: -------------------------------------------------------------------------------- 1 | # Comments 2 | 3 | Comments can be used to provide an explanation or annotation in the script in order to make it easier for other developers to understand what your script is doing. They can also be used to "comment out" lines of code while debugging a script. 4 | 5 | ## Single Line Comments 6 | 7 | PEBakery supports the C++ Style `//` single line comments as well as _.ini_ style single line comments using the hash `#` or semicolon `;` delimiters. Each comment must be placed on its own line and begin with a supported comment delimiter. A comment ends when a newline is started. 8 | 9 | ```pebakery 10 | // This is a comment 11 | # This is also a comment 12 | ; This is another comment! 13 | ``` 14 | 15 | ## Multi-Line/Block Comments 16 | 17 | Block comments are not supported. 18 | 19 | ## Comment Sections 20 | 21 | Section names that begin and end with a hash mark `#` will be treated as a comment section and will be ignored by PEBakery's script engine and syntax checker. 22 | 23 | Unlike Single Line Comments, the contents of a Comment Section will not be displayed in the build log. 24 | 25 | ```pebakery 26 | [#Info#] 27 | This section will be ignored by PEBakery. 28 | ``` -------------------------------------------------------------------------------- /LangRef/Macros.md: -------------------------------------------------------------------------------- 1 | # Macros 2 | 3 | Macros are defined as procedures to be executed when a specific keyword is encountered. 4 | 5 | Macros make script maintenance easier as the code is written only once but can be called repeatedly by any number of scripts or processes. They are ideal for repetitive tasks such as creating shortcuts or downloading and unpacking a file. 6 | 7 | ## Defining a Macro 8 | 9 | Macros can be defined several different ways. 10 | 11 | 1. The [Variables] section of a _.script_ or _script.project_ file. 12 | 1. The SetMacro command. 13 | 1. The projects Application Programming Interface (API) definition. 14 | 15 | Macro names can only consist of following characters `a-z A-Z 0-9 _ ( )`. Because macros are parsed before run-time using %Variables% in the macro name is not supported. 16 | 17 | ### Defining a Macro with the [Variables] Section 18 | 19 | Macros are defined using the .INI style `Key=Value` format. Unlike variables the macro name is **not** enclosed in `%` signs. 20 | 21 | ```pebakery 22 | [Variables] 23 | myMacro=Run,%PluginFile%,DoSomething 24 | ``` 25 | 26 | For more details see [Script Variables](../Projects/ScriptVariables.md) and [Project Variables](../Projects/ProjectVariables.md). 27 | 28 | ### Defining a Macro with the `SetMacro` command 29 | 30 | See the documentation for the [SetMacro](../Commands/Control/SetMacro.md) command. 31 | 32 | ### Defining a "Macro Library" 33 | 34 | The following variables may be used within the _script.project_ Variables section to define a custom "Macro Library" that will be available to the entire project. 35 | 36 | | Variable | Description | 37 | | --- | --- | 38 | | %API% | The full path to a script file containing a "Macro Library". | 39 | | %APIVAR% | The name of the section within the script defined by `%API%` that contains the Macro Definitions to be loaded into the GLOBAL project scope. | 40 | 41 | For more details see [Project Variables](../Projects/ProjectVariables.md). -------------------------------------------------------------------------------- /LangRef/Sections.md: -------------------------------------------------------------------------------- 1 | # Sections 2 | 3 | Sections are specific blocks of code or other information within a script file. In addition to containing data in .INI style `Key=Value` format, Sections can be executed as functions/procedures using commands such as `Run` and `Exec` and can accept parameters and return values as required. 4 | 5 | ## Defining a Section 6 | 7 | Sections are defined by specifying the name of the section within `[]`brackets, (Ex. `[mySection]`) and end when either another section starts or the "end of file" is reached. 8 | 9 | ## Examples 10 | 11 | ### Example 1 12 | 13 | Multiple `Sections` within a script file. 14 | 15 | ```pebakery 16 | [Main] 17 | Title=Section Example 1 18 | Description=Show how sections are defined. 19 | Author=Homes32 20 | Level=5 21 | Version=1 22 | 23 | [Variables] 24 | %a%=1 25 | 26 | [Process] 27 | Run,%ScriptFile%,doSomething,one,two,three,four,five,six,seven,eight,nine,ten,eleven,twelve 28 | 29 | [doSomething] 30 | GetParam,12,%myParam% 31 | Message,"Parameter 12: %myParam%" 32 | 33 | [anotherSection] 34 | // nothing to see here... 35 | 36 | [Interface] 37 | pFileBox1=C:\Images\,1,13,23,44,230,20,dir 38 | pTextLabel1="Select your source directory:",1,1,23,25,230,18,8,Bold 39 | ``` 40 | -------------------------------------------------------------------------------- /Projects/ProjectProcess.md: -------------------------------------------------------------------------------- 1 | # Project [Process] Section 2 | 3 | This sections contains commands that will be executed at the beginning of a build before any other processing occurs. 4 | 5 | Commands placed in this section will be executed whenever one of the following events occurs: 6 | 7 | * The `Build` button is pressed, starting a project build. 8 | * When a Codebox is executed 9 | * When the `Run` button on an individual script is pressed 10 | * When a control on the script's Graphical User Interface triggers a code section to run 11 | 12 | This documentation refers to the `Process` section located within the `script.project` file. For documentation relating to the `Process` section of individual scripts refer to `Script Process`. 13 | 14 | ## Remarks 15 | 16 | Because this section is processed **every time** a project build is started or a script in the project is executed manually, usage of this section should be limited to functions that are Global in nature and are essential to the project. Failure to do so may result in performance penalties and slower build times. 17 | 18 | ## Related 19 | 20 | [Project Main](./ProjectMain.md), [Project Variables](./ProjectVariables.md), [Script Interface](./ScriptInterface.md), [Script Main](./ScriptMain.md), [Script Process](./ScriptProcess.md), [Script Variables](./ScriptVariables.md) 21 | 22 | ## Examples 23 | 24 | In this example we use the _script.project_ process section to define a cleanup function using `System,ONBUILDEXIT`, to ensure any hives or mounted WIM images are cleaned up, even if a script fails and the build halts. 25 | 26 | ### Example 1 27 | 28 | ```pebakery 29 | [Main] 30 | Title=myProject 31 | Description=Example Project 32 | Author=Homes32 33 | Version=1 34 | 35 | [Variables] 36 | 37 | [Process] 38 | System,ONBUILDEXIT,Exec,%ProjectDir%\script.project,myProject-ONBUILDEXIT 39 | 40 | [myProject-ONBUILDEXIT] 41 | // Make sure all registry hives are unloaded. 42 | RegHiveUnload,%RegSystem% 43 | RegHiveUnload,Tmp_Software 44 | RegHiveUnload,%RegDefault% 45 | RegHiveUnload,%RegComponents% 46 | ``` -------------------------------------------------------------------------------- /Projects/ProjectUpdate.md: -------------------------------------------------------------------------------- 1 | # Script [UpdateProject] Section 2 | 3 | This sections controls how PEBakery will perform project updates. 4 | 5 | ## Syntax 6 | 7 | 8 | ## Values 9 | 10 | ## Remarks 11 | 12 | None. 13 | 14 | ## Related 15 | 16 | [Project Update](../Usage/ProjectUpdate.md), [Script Update](../Usage/ScriptUpdate.md) 17 | 18 | ## Examples 19 | 20 | ### Example 1 21 | -------------------------------------------------------------------------------- /Projects/README.md: -------------------------------------------------------------------------------- 1 | # Projects 2 | 3 | Projects are a collection of scripts that work together to instruct PEBakery how to build a PE Environment. 4 | 5 | ## Project Files 6 | 7 | There are 4 types of files used by PEBakery. 8 | 9 | Click on the file name in the table below for details on each file type. 10 | 11 | | Name | Description | 12 | | --- | --- | 13 | [.Link](./LinkFiles.md) | .Link files allow you to reference individual script files that are not located under your project's directory. | 14 | [.Script](./ScriptFiles.md) | .Script files are the building blocks of a project and contain the commands and logic needed to build your PE. | 15 | [Folder.Project](./FolderFiles.md) | Contains information about a folder in PEBakery. This file can also be used to create links to other folders containing scripts that are not located under your project's directory. | 16 | [Script.Project](./ProjectFiles.md) | The `Script.Project` file defines a project. | 17 | -------------------------------------------------------------------------------- /Projects/ScriptFiles.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pebakery/pebakery-docs/6cb394caf4ec37a33d7a82dad03dab46516757ee/Projects/ScriptFiles.md -------------------------------------------------------------------------------- /Projects/ScriptProcess.md: -------------------------------------------------------------------------------- 1 | # Script [Process] Section 2 | 3 | This sections contains the main logic of the script. 4 | 5 | Commands placed in this section will be executed during a project build or when the `Run` button on the scripts Graphical User Interface is pressed. 6 | 7 | This documentation refers to the `Process` section located within the `.script` files. For documentation relating to the `Process` section for `script.project` refer to `Project Process`. 8 | 9 | ## Remarks 10 | 11 | None. 12 | 13 | ## Related 14 | 15 | [Project Main](./ProjectMain.md), [Project Process](./ProjectProcess.md), [Project Variables](./ProjectVariables.md), [Script Interface](./ScriptInterface.md), [Script Main](./ScriptMain.md), [Script Variables](./ScriptVariables.md) 16 | 17 | ## Examples 18 | 19 | ### Example 1 20 | 21 | ```pebakery 22 | [Main] 23 | Title=My App Script 24 | Description=Adds myApp the the project. 25 | Author=Homes32 26 | Credits=Thanks to ied206 for creating PEBakery! 27 | Selected=True 28 | Level=5 29 | Version=1 30 | 31 | [Variables] 32 | 33 | [Process] 34 | Message,"Hello World!" 35 | ``` -------------------------------------------------------------------------------- /Projects/ScriptUpdate.md: -------------------------------------------------------------------------------- 1 | # Script [ScriptUpdate] Section 2 | 3 | This sections controls how PEBakery will perform script updates. 4 | 5 | ## Syntax 6 | 7 | Script update data is stored in .INI style `Key=Value` format. 8 | 9 | ## Values 10 | 11 | The following values are used by PEBakery to perform a script update. 12 | 13 | | Name | Description | 14 | | --- | --- | 15 | | UpdateType | The update channel used by this script: | 16 | || Standalone - The script provides it's own update information, independent of the project. This channel is used for 3rd party/independent developers that want to provide script updates independent of the project. | 17 | || Project - The project author defines the update information for the script. | 18 | | Url | The URL from which the .script will be downloaded. | 19 | 20 | ## Remarks 21 | 22 | None. 23 | 24 | ## Related 25 | 26 | [ProjectUpdate Section](./ProjectUpdate.md), [Project Update](../Usage/ProjectUpdate.md), [Script Update](../Usage/ScriptUpdate.md) 27 | 28 | ## Examples 29 | 30 | ### Example 1 31 | 32 | ```pebakery 33 | [Main] 34 | Title=My App Script 35 | Description=Adds myApp the the project. 36 | Author=Homes32 37 | Credits=Thanks to ied206 for creating PEBakery! 38 | Selected=True 39 | Level=5 40 | Version=1 41 | 42 | [ScriptUpdate] 43 | UpdateType=Standalone 44 | Url=https://myproject.org/pebakery/myScript.script 45 | 46 | [Variables] 47 | 48 | [Process] 49 | Message,"Hello World!" 50 | ``` -------------------------------------------------------------------------------- /Projects/ScriptVariables.md: -------------------------------------------------------------------------------- 1 | # Script [Variables] Section 2 | 3 | This section contains any predefined variables and macros the script needs to reference. The variables are loaded into memory when the script is processed during a build, a section within the script is called using the `Exec` command, or when another script loads them with the `AddVariables` command. 4 | 5 | This documentation refers to the `Variables` section located within the `.script` files. For documentation relating to the `Variables` section for `script.project` refer to `Project Variables`. 6 | 7 | ## Syntax 8 | 9 | Script variables and macros are defined using the .INI style `Key=Value` format. Variables must be enclosed in `%` percent signs. 10 | 11 | ### Variables 12 | 13 | ```pebakery 14 | %myProgramName%="My Program" 15 | ``` 16 | 17 | ### Macros 18 | 19 | ```pebakery 20 | myMacro=Run,%PluginFile%,DoSomething 21 | ``` 22 | 23 | Note that the macro name is **not** enclosed in `%` signs. 24 | 25 | ## Remarks 26 | 27 | None. 28 | 29 | ## Related 30 | 31 | [AddVariables](../Commands/Control/AddVariables.md), [Exec](../Commands/Branch/Exec.md), [Project Main](./ProjectMain.md), [Project Process](./ProjectProcess.md), [Project Variables](./ProjectVariables.md), [Script Interface](./ScriptInterface.md), [Script Main](./ScriptMain.md), [Script Process](./ScriptProcess.md), [Macros](../LangRef/Macros.md) 32 | 33 | ## Examples 34 | 35 | ### Example 1 36 | 37 | ```pebakery 38 | [Main] 39 | Title=Variables Section 40 | Description=Variables Section Example 41 | Author=Homes32 42 | Level=5 43 | Version=1 44 | 45 | [Variables] 46 | %myProgramName%="My Program" 47 | myMacro=Run,%ScriptFile%,EchoMessage 48 | 49 | [Process] 50 | myMacro,%myProgramName% 51 | 52 | [EchoMessage] 53 | Echo,#1 54 | Message,#1 55 | ``` -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PEBakery Manual 2 | 3 | Welcome to the PEBakery Manual! 4 | 5 | ## Table of Contents 6 | 7 | 1. Using PEBakery 8 | * Main Window 9 | * Settings 10 | * [Projects](./Usage/Settings-Projects.md) 11 | * [General](./Usage/Settings-General.md) 12 | * [Interface](./Usage/Settings-Interface.md) 13 | * [Script](./Usage/Settings-Script.md) 14 | * [Log](./Usage/Settings-Log.md) 15 | * [Compatibility](./Usage/Settings-Compatibility.md) 16 | * [Logs](./Usage/Logs.md) 17 | * [Utilities](./Usage/Utilities.md) 18 | * Update 19 | * [Script Update](./Usage/ScriptUpdate.md) 20 | * [Project Update](./Usage/ProjectUpdate.md) 21 | 1. Scripting Reference 22 | * [.Script Syntax](./LangRef/Syntax.md) 23 | * [Comments](./LangRef/Comments.md) 24 | * [Variables](./LangRef/Variables.md) 25 | * [Macros](./LangRef/Macros.md) 26 | * [Project Components](./Projects/README.md) 27 | * [Scripts](./Projects/ScriptFiles.md) 28 | * [Links](./Projects/LinkFiles.md) 29 | * [Folders](./Projects/FolderFiles.md) 30 | * [Projects](./Projects/ProjectFiles.md) 31 | * [Commands](./Commands/README.md) 32 | * [Sections](./LangRef/Sections.md) 33 | * [GUI Controls](./GUIControls/README.md) 34 | 1. Appendix 35 | * [Bug Reports](./BugReport/README.md) 36 | * [Coding Guide](./CodingGuide/README.md) 37 | * [Command Line Usage](./Usage/CommandLine.md) 38 | * [Deprecated Commands](./Commands/Deprecated.md) 39 | * [License](LICENSE) 40 | * [Migrating from Winbuilder](./CodingGuide/Migrating.md) -------------------------------------------------------------------------------- /Usage/CommandLine.md: -------------------------------------------------------------------------------- 1 | # PEBakery Command Line Arguments 2 | 3 | PEBakery supports several command-line arguments useful for developers. 4 | 5 | ## Arguments 6 | 7 | PEbakey supports the following command-line arguments: 8 | 9 | | Argument | Description | 10 | | --- | --- | 11 | | -b, --baseDir | The base directory PEBakery will use for loading projects/settings. | 12 | | --help | Display the PEBakery command-line help message. | 13 | | --version | Display PEBakery version information. | 14 | -------------------------------------------------------------------------------- /Usage/ProjectUpdate.md: -------------------------------------------------------------------------------- 1 | # Project Update 2 | 3 | Project update has not been implemented yet. -------------------------------------------------------------------------------- /Usage/README.md: -------------------------------------------------------------------------------- 1 | # Using PEBakery 2 | 3 | * Main Window 4 | * Settings 5 | * [Projects](./Settings-Projects.md) 6 | * [General](./Settings-General.md) 7 | * [Interface](./Settings-Interface.md) 8 | * [Script](./Settings-Script.md) 9 | * [Log](./Settings-Log.md) 10 | * [Compatibility](./Settings-Compatibility.md) 11 | * [Logs](./Logs.md) 12 | * Utilities 13 | * Update 14 | * [Script Update](./ScriptUpdate.md) 15 | * [Project Update](./ProjectUpdate.md) -------------------------------------------------------------------------------- /Usage/ScriptUpdate.md: -------------------------------------------------------------------------------- 1 | # Script Update 2 | 3 | **Warning: Update functionality is in active development and may change without notice!** 4 | 5 | PEBakery contains built-in update functionality for scripts that can be used by individual developers and project authors alike. It is triggered by the "Script update" button. 6 | 7 | ## Update Configuration 8 | 9 | Script updates are configured via the [[ScriptUpdate]](../Projects/ScriptUpdate.md) section in each individual script file. 10 | 11 | ### Update Metadata 12 | 13 | In order to reduce network bandwidth, information about the script on the update server is contained in a file called `.meta.json`. The meta-data file is in standard JSON format and contains information needed by the update process, such as the script's version, and any required dependencies. 14 | 15 | More information about the `meta.json` file and the information it contains can be found in the [Update Server](./UpdateServer.md) guide. 16 | 17 | ## The Update Process 18 | 19 | When the Script Update button is pressed PEBakery performs the following steps to determine if/how the script needs to be updated. 20 | 21 | 1. Read the value of UpdateType from the script's `[ScriptUpdate]` section. 22 | 1. Read the value of URl from the scrip's `[ScriptUpdate]` section. 23 | 1. Download script's meta-data from `/.meta.json`. 24 | 1. Read the script's meta-data to determine if an update is necessary. PEBakery compares the version number from the scripts `[Main]` section to the version property in the script's update configuration. 25 | 1. Backup the current script's interface values. 26 | 1. Download the new script to a temporary location. 27 | 1. Upon successful download the old script is removed and the new script copied in it's place. 28 | 1. Restore the script's previous interface values to the best of our ability. -------------------------------------------------------------------------------- /Usage/Settings-General.md: -------------------------------------------------------------------------------- 1 | # General Settings 2 | 3 | Settings related to the general behavior of the PEBakery engine. 4 | 5 | ## Settings 6 | 7 | General settings may be configured via the **PEBakery > Settings > General** tab or by manually editing `PEBakery.ini` located in PEBakery's root directory *(eg. C:\PEBakery\PEBakery.ini)*. 8 | 9 | ### Build 10 | 11 | | Setting | Default | Description | 12 | | --- | --- | --- | 13 | | [Optimize code](../CodingGuide/CommandOp.md) | True | Allows PEBakery to automatically optimize some commands related to file manipulation. | 14 | | Show LogWindow after build | True | Show the log dialog when a build finishes. | 15 | | Stop build on error | True | When enabled the build will halt on all errors. | 16 | 17 | ### Advanced 18 | 19 | | Setting | Default | Description | 20 | | --- | --- | --- | 21 | | Enable long file path support | False | Allow PEBakery to override the Windows 260 character path limit and recognize filenames up to 32767 characters. **Warning:** Enabling this option can have unintended side affects. See [PEBakery Issue #135](https://github.com/pebakery/pebakery/issues/135) for details. | 22 | | Enable update server management | False | Enable the ability to create script meta files. These files are used by PEBakery's internal script updater. See [Update Server](./UpdateServer.md) for details. | 23 | 24 | ### User-Agent 25 | 26 | | Setting | Default | Description | 27 | | --- | --- | --- | 28 | | Custom User-Agent for WebGet | False | Allows you to override the default user-agent string (`PEBakery/`) used in WebGet operations. | -------------------------------------------------------------------------------- /Usage/Settings-Interface.md: -------------------------------------------------------------------------------- 1 | # Interface Settings 2 | 3 | Settings related to the PEBakery's graphical user interface. 4 | 5 | ## Settings 6 | 7 | Interface settings may be configured via the **PEBakery > Settings > Interface** tab or by manually editing `PEBakery.ini` located in PEBakery's root directory *(eg. C:\PEBakery\PEBakery.ini)*. 8 | 9 | ### PEBakery Interface 10 | 11 | | Setting | Default | Description | 12 | | --- | --- | --- | 13 | | Display console output in ShellExectue | True | When enabled the build process will display the output from programs executed with `ShellExecute,Hide` in the progress window. StdOut will be displayed in black text, StdErr will be displayed in red text. | 14 | | Custom Title | False | Allows you to change the caption on PEBakery's main window. | 15 | | Interface Size | Adaptive | Configures the interface resizing method. | 16 | | | Adaptive | Automatically scale PEBakery's top menu based on the screen resolution. | 17 | | | Standard | Force PEBakery's top menu to use standard size buttons. | 18 | | | Small | Force PEBakery's top menu to use small buttons. | 19 | | Script Scale Factor (%) | 100% | Adjust the scaling of the scripts interface. | 20 | | Monospaced Font | Configure the font used by various portions of PEBakery. (ShellExecute output, combobox, codebox, etc.) | 21 | 22 | ### External Code Editor 23 | 24 | | Setting | Default | Description | 25 | | --- | --- | --- | 26 | | Custom Editor | False | Allows you to specify the program used to edit the script source. If this option is disabled PEBakery will attempt to launch an editor using the current operating system's default file associations. | 27 | -------------------------------------------------------------------------------- /Usage/Settings-Log.md: -------------------------------------------------------------------------------- 1 | # Log Settings 2 | 3 | Settings related to PEBakery's log handling. 4 | 5 | PEBakery stores all system and build logs in a SQLLite database located in `%BaseDir%\Database`. 6 | 7 | ## Settings 8 | 9 | Log settings may be configured via the **PEBakery > Settings > Log** tab or by manually editing `PEBakery.ini` located in PEBakery's root directory *(eg. C:\PEBakery\PEBakery.ini)*. 10 | 11 | ### Logging 12 | 13 | | Setting | Default | Description | 14 | | --- | --- | --- | 15 | | Clear Logs | | Pressing this button will clear the log database. | 16 | | Debug Level | Production | This setting can be adjusted to provide more detailed debug logging. | 17 | | | | Production - Normal logging. | 18 | | | | PrintException - Include .NET runtime exceptions in the log. | 19 | | | | PrintExceptionStackTrace - Include .NET runtime exceptions and a full stack trace in the log. | 20 | 21 | ### Optimization 22 | 23 | | Setting | Default | Description | 24 | | --- | --- | --- | 25 | | Deferred Logging | True | This setting dramatically increases performance by deferring log writes to the database until after the current script's execution has finished. **Disabling this setting is not recommended**, though may be useful for debugging as it allows you to follow the log in real-time during a build. | 26 | | Compact exported HTML log | True | Enable compacting the HTML logs to save space. | 27 | 28 | -------------------------------------------------------------------------------- /Usage/Settings-Projects.md: -------------------------------------------------------------------------------- 1 | # Project Settings 2 | 3 | Settings related to the selected project. 4 | 5 | ## Settings 6 | 7 | Project settings may be configured via the **PEBakery > Settings > Projects** tab or by manually editing `PEBakery.ini` located in PEBakery's root directory *(eg. C:\PEBakery\PEBakery.ini)*. 8 | 9 | ### Default Project 10 | 11 | | Setting | Description | 12 | | --- | --- | 13 | | Default Project | Project | DefaultProject | Specifies the "Startup Project" that will be automatically selected when PEBakery is launched. | 14 | 15 | ### Source Setup (Legacy) 16 | 17 | This section is included for backwards compatibility with Winbuilder and allows for configuration of variables associated with the source and output directory fields located on Winbuilder's `Source` tab. 18 | 19 | Modern projects should disable these settings to avoid confusion. 20 | 21 | | Setting | Description | 22 | | --- | --- | 23 | | Project to Configure | Select the project to configure sources for. | 24 | | Source Directory | Sets the value of the `%SourceDir%` variable. | 25 | | Target Directory | Sets the value of the `%TargetDir%` variable. | 26 | | ISO File | Sets the value of the `%ISOFile%` variable. | -------------------------------------------------------------------------------- /Usage/Settings-Script.md: -------------------------------------------------------------------------------- 1 | # Script Settings 2 | 3 | Settings related to PEBakery's script handling. 4 | 5 | ## Settings 6 | 7 | Script settings may be configured via the **PEBakery > Settings > Script** tab or by manually editing `PEBakery.ini` located in PEBakery's root directory *(eg. C:\PEBakery\PEBakery.ini)*. 8 | 9 | ### Script Cache 10 | 11 | | Setting | Default | Description | 12 | | --- | --- | --- | 13 | | Enable script cache | True | When enabled PEBakery serializes and caches all scripts in a SQLLite database (located in `%BaseDir%\Database`) in order to improve load times. | 14 | | Clear Cache | | Pressing this button clears the database. The script cache will be rebuilt when the project is Refreshed. | 15 | 16 | ### Syntax Check 17 | 18 | | Setting | Default | Description | 19 | | --- | --- | --- | 20 | | Auto check syntax errors | True | Automatically check scripts for syntax errors. | -------------------------------------------------------------------------------- /Usage/Settings-Theme.md: -------------------------------------------------------------------------------- 1 | # Theme Settings 2 | 3 | Settings related to the PEBakery's graphical user interface. 4 | 5 | ## Settings 6 | 7 | Theme settings may be configured via the **PEBakery > Settings > Theme** tab or by manually editing `PEBakery.ini` located in PEBakery's root directory *(eg. C:\PEBakery\PEBakery.ini)*. 8 | 9 | ### Theme Preset 10 | 11 | Choose from one of PEBakery's pre-defined color themes. 12 | 13 | ### Custom Theme 14 | 15 | Manually define the color scheme for various UI elements. -------------------------------------------------------------------------------- /Usage/Utilities.md: -------------------------------------------------------------------------------- 1 | # PEBakery Utilities 2 | 3 | PEBakery Utilities are a collection of tools useful for project and script developers. 4 | 5 | ## Codebox 6 | 7 | Codebox is a disposable script processor that can be used to quickly test commands and code snippets in the context of a specific project. Each CodeBox script runs under the exact same conditions as any other script inside your selected project, making this a good tool for debugging variables and commands. 8 | 9 | The contents of the CodeBox are stored in `CodeBox.txt`, which is located in the base directory (`%BaseDir%`) of your project. 10 | 11 | At minimum each CodeBox must contain a `[Process]` section. 12 | 13 | ## String Escaper 14 | 15 | The String Escaper tool allows you to quickly escape or unescape special characters in a string. 16 | 17 | For more information on escape characters please refer to the [Script Syntax](../LangRef/Syntax.md) documentation. 18 | 19 | ## Syntax Checker 20 | 21 | The Syntax Checker validates code snippets to ensure they will run correctly in PEBakery. --------------------------------------------------------------------------------