eXternal Command - command-line wrapper for batch and shell
A collection of commonly used batch and shell functions.
- xlib/xlib.cmd - Uses only first-party tools, works out of the box with dozens of practical commands
- x3rd/x3rd.cmd - Wraps third-party command-line tools
- Cross-platform support for Windows, macOS, and Linux
- Built-in error handling and help system
- Support for UNC paths (Windows SMB)
- Minimal dependencies and easy to deploy
- Download
xlib.cmdand/orx3rd.cmd - Add the script directory to your PATH environment variable
- Ensure the script uses
CRLFline endings - Avoid using non-ANSI characters in the script
- Download
xliband/orx3rd - Add execute permission:
chmod +x xlib - Add the script directory to your PATH
- Ensure the script uses
LFline endings
# Show help
xlib -h
xlib --help
# Show version
xlib version# Windows
xlib.cmd <command> [options]
# macOS/Linux
xlib <command> [options]- Use
-hor--helpto get usage help for any command - Use
-hor--helpafter a command to get detailed help for that specific command
Wake up a computer on the same network:
# aa:bb:cc:dd:ee:ff is the target NIC MAC address
xlib wol aa:bb:cc:dd:ee:ffEncrypt all disks on a computer without TPM support:
# Prepare a FAT32 USB device for storing startup keys
xlib vol --encrypts-all
# Run from UNC path (SMB server)
\\192.168.1.1\xcmd\xlib vol --encrypts-all
# Hide encryption indicators and BitLocker menu
xlib vol --hide-bitlocker
# For more details
xlib vol --helpCapture original PKG installation packages from AppStore:
xlib pkg -g 5Then open AppStore and download apps. PKG files will appear in the Downloads folder.
Search and access computers with dynamic IPs using fixed names:
- Create
.host.iniin%USERPROFILE%or$HOME:
[hosts]
; Single MAC address, ignored if not matched
gl.inet=00:11:00:00:00:00
; Match from left, fallback to 127.0.0.1 if no match
syno-15=00-11-00-00-11-00|11:00:00:00:00:11|00-11-00-00-00-11|127.0.0.1
; Direct IPv4 address
binave.com=127.0.0.1
[sip_setting]
; IPv4 search range
range=1-120- Run the command (requires admin privileges):
xlib hostsSet up a customizable Microsoft Office installation service:
# Download latest Office installation files
xlib odt -d \\192.168.1.1\xcmd
# Install specific components
\\192.168.1.1\xcmd\xlib odt -i word excel powerpointActivate Windows and Office using KMS service:
# Activate Windows
xlib kms -s 192.168.1.1
# Activate Office
xlib kms -o 192.168.1.1Transfer small files/folders via RDP clipboard (for older Windows versions):
- Download
clipTransfer.vbson both local and remote machines - Drag files/folders onto the VBS script on one end
- Wait for completion
- Double-click the VBS script on the other end to receive
- Supports use in
for /fcommands (usecallfor conditional operations) - Function name auto-completion (matches characters from left to right)
- Multi-process control support (e.g.,
hostsfunction) - Virtual disk control, WIM file manipulation, string operations, hash calculation
- VBS script integration via
xlib vbscommand for downloads and transcoding
- Shell implementation of complex data structures (dictionaries, queues, etc.)
- Platform-specific functions for macOS and Linux
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for the full license text.