Here you will find some example scripts to give you an idea on using the shell.

Recursive function call

# Demonstrate recursive function calls

const MAX_COUNT int <= 10;

function recursive void(count int)
  if (%count, -ls, %MAX_COUNT) {
    ++ count;
    print "Count value: %count";
    call recursive(%count) => void;

call recursive(0) => void;

print "Done.";


Run Windows dialog to set time and date

# Run timedate.cpl

function clock void() {
    sys { timedate.cpl };

call clock() => void;

Get Internet IP address from a service

# Get Internet IP address of this machine

const SERVICE_URL string <= "https://www.example.tld/ip.php";

global ipaddr string;

sys {curl "%SERVICE_URL" --silent} ipaddr;

print "IP address: %ipaddr";

Upgrade composer dependencies of various projects

# Upgrade composer dependencies

require "array";
require "auto";

static_array arrProjects string (

function upgrade_dependencies void(folder string)
    print "Upgrading %folder...";
    aut_run "composer" "update --working-dir %folder" "%folder" void;

print "Upgrading projects...";

for (i, 0, %arrProjects.length, -inc) {
    call upgrade_dependencies(%arrProjects[%i]) => void;

print "Done.";

Generate a testing password via external program

# Quickly generate BCRYPT password via PHP

require "strings";
require "miscutils";

const C_TEST_PASSWORD string <= "test";

global expression string;
global exprlen int;

set expression <= "%2";

s_getlen "%expression" exprlen;
if (%exprlen, -ls, 3) {
    set expression <= "%C_TEST_PASSWORD";

function genenrate_password void()
    local output string;
    sys {php -r "echo password_hash('%expression', PASSWORD_BCRYPT);"} output;
    print "%output";
    clpb_setstring "%output";
    print "Copied to clipboard!";

call genenrate_password() => void;

Get week day via external program

# Get weekday of given or current date

function weekday void(date string) {
    local dayname string;
    if (%date, -eq, "") {
        fmtdatetime "%Y-%m-%d" date;
    sys {php -r "echo date('l', strtotime('%date'));"} dayname;
    print "%dayname";

Show environment variables via GUI

# Show environment variables via GUI

require "strings";
require "forms";

global frmMain int;
global bres bool;
global envcont string;

wnd_spawnform "frmMain" "Windows Environment Variables" 200 300 500 350 frmMain;

wnd_isformvalid frmMain bres;

if (%bres, -eq, false) {
    print "Failed to create form.";

wnd_spawnlistview "frmMain" "lvVariables" 10 10 467 295;
wnd_lvaddcategory "frmMain" "lvVariables" "Name" 225 true;
wnd_lvaddcategory "frmMain" "lvVariables" "Value" 220 true;

sys {set} envcont;

s_tokenize "%envcont" "%CR%LF" splittedvars;

global szVarName string;
global szVarValue string;
global numTokenIndex int;

for (i, 0, %splittedvars.count, -inc) {
    s_find "%splittedvars[%i]" "=" numTokenIndex;
    if (%numTokenIndex, -gr, 0) {
        s_substr "%splittedvars[%i]" 0 %numTokenIndex szVarName;

        ++ numTokenIndex;
        s_substr "%splittedvars[%i]" %numTokenIndex -1 szVarValue;

        wnd_lvsetitemtext "frmMain" "lvVariables" "%szVarName" 0 bres;
        wnd_lvsetsubitemtext "frmMain" "lvVariables" 0 "%szVarValue" 1 bres;

while (%bres, -eq, true) {

    wnd_isformvalid frmMain bres;

Check if internet is available

# Check if internet is available

require "array";
require "strings";

static_array arrDomains string (

global checkresult bool;

function check_availability bool(domain string)
    local response string;
    local httprespos int;

    result false;

    print "Checking via domain: %domain";

    sys {curl "%domain" -X HEAD -I --silent} response;

    s_find "%response" "HTTP/1.1 200 OK" httprespos;
    if (%httprespos, -eq, 0) {
        result true;

global resultcount int;
set resultcount <= 0;

for (i, 0, %arrDomains.length, -inc) {
    call check_availability("%arrDomains[%i]") => checkresult;

    if (%checkresult, -eq, true) {
        ++ resultcount;

if (%resultcount, -gr, 0) {
    print "Internet is available (%resultcount/%arrDomains.length succeeded).";
} else {
    print "All connection attempts failed.";

Speak text entered via GUI input box

# Speak text entered via GUI input box

require "inputbox";
require "speech";

const SPEECH_VOLUME int <= 100;

function prompt_and_speak void()
    local text string;

    inputbox "Speech Prompt" "Enter a text to speak" "Hello World!" 200 300 text;
    if (%text, -nt, "") {
        spk_setvolume %SPEECH_VOLUME;
        spk_speak "%text";

call prompt_and_speak() => void;

Remove all files and folders in a directory

# Remove all files and folders in a directory

require "array";
require "fileio";
require "textinput";

dynamic_array arrFiles string 1 ("");
dynamic_array arrFolders string 1 ("");

function EnumObjects int(baseObject string, iteratedObject string)
    local dirtype bool;
    fdisdir "%baseObject%iteratedObject" dirtype;
    if (%dirtype, -eq, true) {
        item_append arrFolders "%baseObject%iteratedObject";
        denum {%baseObject%iteratedObject\} "*.*" "EnumObjects" void;
    } else {
        item_append arrFiles "%baseObject%iteratedObject";

    result 1;

function ClearFiles void()
    local fremres bool;

    for (i, 1, %arrFiles.length, -inc) {
        print "Clearing file: %arrFiles[%i]";
        fremove "%arrFiles[%i]" fremres;

function ClearFolders void()
    local dremres bool;

    for (i, 1, %arrFolders.length, -inc) {
        print "Clearing folder: %arrFolders[%i]";
        dremove "%arrFolders[%i]" dremres;

global inputdir string;
global enumres bool;

input inputdir "Please enter a folder to be entirely cleared: ";

print "Clearing entire folder: %inputdir";

denum "%inputdir" "*.*" "EnumObjects" enumres;

call ClearFiles() => void;
call ClearFolders() => void;

print "Done.";