DoScript is a small, safe, human-readable scripting language built for system automation. Think Batch 2.0: clean syntax, built-in safety, and powerful enough to write real installers, file sorters, and deployment tools — without ever needing to know Python or PowerShell.
ask name "What's your project called?"
make folder '{name}'
download "https://example.com/starter.zip" to 'starters/{name}.zip'
unzip 'starters/{name}.zip' to '{name}'
say 'Done! Your project is ready in /{name}'
| Batch | PowerShell | DoScript | |
|---|---|---|---|
| Beginner-friendly | ❌ | ✅ | |
| Human-readable syntax | ❌ | ❌ | ✅ |
| Built-in dry-run | ❌ | ❌ | ✅ |
| Structured error handling | ❌ | ✅ | ✅ |
| File metadata in loops | ❌ | ✅ | ✅ |
| HTTP client built in | ❌ | ✅ | ✅ |
| Distributable as .exe | ❌ | ✅ |
- Human-readable DSL — scripts read like plain English instructions
--dry-runbuilt in — simulate destructive operations safely before running them- Rich file loops — iterate files with auto-injected metadata: name, size, extension, age, content, and more
- Structured error handling —
try/catch NetworkError,FileError,ProcessError,DataError - Full HTTP client —
download,http_get,http_post,upload,pingout of the box - Real functions — parameters, return values, and local variable scoping
- Modular scripts —
includelibraries, chain scripts withdo_new - Clear errors — every error reports the file name, line number, and source line
- Distributable — ships as
doscript.exe, embeds easily in any toolchain
Download the latest installer from the Releases page and run it.
do script.do
Requires Python 3.8+:
python doscript.py myscript.do
do <script.do> [--dry-run] [--verbose] [args...]
| Flag | What it does |
|---|---|
--dry-run |
Simulates all destructive operations — nothing is written, moved, or deleted |
--verbose |
Prints extra execution detail |
arg1…arg32 |
CLI arguments available inside the script |
global_variable = name, age
name = "Alice"
age = 30
say 'Hello, {name}! You are {age} years old.'
ask answer "Continue? (y/n)"
Use single quotes for strings with
{variables}. Double quotes are always literal.
if age >= 18 and age < 65
say "Working age."
end_if
loop 3
say "Retrying..."
wait 1
end_loop
make folder "output"
copy "report.pdf" to "backup/report.pdf"
zip "output" to 'output_{today}.zip'
for_each file_in here
if_ends_with ".log"
if file_is_old_days > 30
delete file_path
end_if
end_if
end_for
try
download "https://example.com/app.zip" to "app.zip"
say "Download complete!"
catch NetworkError
say "Check your connection and try again."
exit 1
end_try
function greet name
say 'Hello, {name}!'
end_function
greet("World")
say "==========================="
say " MyApp Installer v1.0"
say "==========================="
global_variable = confirm
ask confirm "Install MyApp? (y/n)"
if confirm == "y"
make folder "C:/MyApp"
try
download "https://example.com/myapp.zip" to "C:/MyApp/myapp.zip"
catch NetworkError
say "Download failed. Visit: https://example.com/myapp"
exit 1
end_try
unzip "C:/MyApp/myapp.zip" to "C:/MyApp"
path add "C:/MyApp/bin"
delete "C:/MyApp/myapp.zip"
say "Done! Run 'myapp' from any terminal."
else
say "Installation cancelled."
end_if
pause
DoScript is designed so that mistakes are hard to make and easy to catch.
--dry-runreplaces every destructive operation with a[DRY]log message — nothing is touched- Explicit destructive commands (
delete,move) are clearly named so intent is visible try/catchwith typed errors means network and file failures never silently crash a script- Structured logging with
log,warn, anderrormakes unattended scripts easy to monitor
The /learn folder contains eight step-by-step lessons:
| Lesson | Topic |
|---|---|
| 01 — Basics | Variables, say, ask, comments, quote rules |
| 02 — Control Flow | if/else, loop, repeat, break, try/catch |
| 03 — Files | make, copy, move, delete, zip, read_content |
| 04 — for_each | File iteration, metadata variables, if_ends_with |
| 05 — Functions | Functions, macros, include |
| 06 — Network | download, http_get/post, ping, upload |
| 07 — Installers | Writing real installer scripts end-to-end |
| 08 — Tips & Patterns | Community patterns, common gotchas |