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
- Support for Windows, macOS, and Linux
- Built-in error handling and help system
- Support for UNC paths (Windows SMB)
- Easy to deploy
-
xjar - JAR application process manager and operations tool, (for linux only)
-
qrsender.sh/qrsender.cmd - Transfer files from Linux to Windows via
QR code
- 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 command help
xlib <command> -h
xlib <command> --help
# Show version
xlib version- 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:ffLoad the file %USERPROFILE%\.batchrc before running cmd.exe
Similar to Linux/Mac's ~/.bashrc
xlib var --install-config
:: or
xlib var -icEncrypt 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 hostsAutomated Microsoft Office Installation
:: help info
xlib odt -h
:: Download the latest Office installation files first
xlib odt -d \\192.168.1.1\xcmd 2024
xlib odt -d D:\ 2021
:: Automatically install specified components
\\192.168.1.1\xcmd\xlib odt -i word excel powerpoint 2024Automatically activate Windows and Office using KMS service:
:: Using KMS service activate Windows
xlib kms -s 192.168.1.1
:: Using KMS service activate Office
xlib kms -o 192.168.1.1
:: Using KMS service activate Windows and Office
\\192.168.1.1\xcmd\xlib kms -aTransfer 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
- Process Management: Start/Stop/Restart JAR applications
- Log Management: View, redirect, auto-rotate, and clean logs
- Status Monitoring: Display process information, CPU/memory usage, network connections, and thread details
- Batch Operations: Supports multi-directory batch management
- Debugging Support: Supports JDWP remote debugging
- Features: Transfer files in isolated environments where USB, network, or Bluetooth cannot be used.
- Principle: The sender displays the QR code sequence sequentially as an animation on the terminal (with progress numbers). The receiver automatically scans the QR code sequence to reconstruct the original file and calculates packet loss. The sender retransmits based on the sequence numbers.
This project is licensed under the Apache License, Version 2.0. See the LICENSE file for the full license text.