PyRcEdit is a modern Python reimplementation of the archived
rcedit tool originally developed by GitHub/Electron.
It is a fast, lightweight command-line utility for editing embedded resources inside Windows PE files (.exe / .dll).
Unlike the original C++ tool, PyRcEdit is:
- Written in pure Python
- Uses ctypes to call native Win32 APIs
- Requires no C++ toolchain (no Visual Studio, no CMake)
- Easy to integrate into CI/CD pipelines
β οΈ Important Notes
β’ PyRcEdit runs only on Windows, as it relies on native Win32 APIs.
β’ Some executables may become corrupted after modification. Always keep a backup copy of your file before editing.
- π Modify Version String attributes (e.g., File Description, Company Name)
- π¨ Replace application icons (
.ico) - π‘οΈ Change UAC Execution Levels (
asInvoker,requireAdministrator, etc.) - π Inject or update application manifests
- π€ Edit localized string resources (
RT_STRING) - π¦ Embed or replace raw binary data (
RT_RCDATA) - β‘ Zero compilation required β just download the
.exe, add to PATH, and use it anywhere
Download the latest PyRcEdit.exe from the Releases page:
π https://github.com/pixcapsoft/PyRcEdit/releases/latest
After downloading:
- Place the file anywhere you like
- Add the folder to your System PATH
- Run
pyrceditfrom any directory
git clone https://github.com/pixcapsoft/PyRcEdit.git
cd PyRcEdit
pip install pyinstaller
pyinstaller --onefile --console --name pyrcedit pyrcedit.py- Windows OS
- Python 3.11+ (If you want build from source)
Simply run the PyRcEdit with your target executable and the desired flags:
pyrcedit "path-to-file.exe" [options...]Pro Tip: You can chain multiple options in a single command!
pyrcedit "E:\MyFile\app.exe" --set-icon "icon.ico" --set-file-version "1.0.0.0"
β οΈ Important: Always provide the full path to the executable.
Relative paths may cause:
fatal error : Unable to commit change
If you frequently run the same commands, place them in a pyrcedit.prec file at your project folder and run:
pyrcedit .Example pyrcedit.prec contents:
"E:\MyFile\app.exe" --set-product-version 1.0.0.0 --set-icon "app.ico"
π This feature is really suitable for developers who want to edit their build files each time they build again.
For example imagine this:
You compiling python application using some compiler that won't let you change the output file's icon. Output file located in build folder. You only had to create pyrcedit.prec file inside the build folder with following code.
<Full-Path-To-Your-EXE> --set-icon <Your-Icon>Then after compiling your application simply run:
pyrcedit .and see the magic...
| Command | Description |
|---|---|
-h, --help |
Show the help message and exit. |
-v, --version |
Print current version of the PyRcEdit |
--repo |
Get the official repo link and credits |
| Command | Description | Example |
|---|---|---|
--set-version-string <key> <value> |
Set a specific version string property. | --set-version-string "CompanyName" "MyCompany" |
--get-version-string <key> |
Print a specific version string. | --get-version-string "CompanyName" |
--set-file-version <version> |
Set the FileVersion attribute. |
--set-file-version "1.2.3.4" |
--set-product-version <version> |
Set the ProductVersion attribute. |
--set-product-version "1.2.3.4" |
| Command | Description | Example |
|---|---|---|
--set-icon <path-to-ico> |
Replace the executable's .ico file. |
--set-icon "./assets/app.ico" |
| Command | Description | Example |
|---|---|---|
--set-requested-execution-level <level> |
Set UAC level in manifest. Valid options: asInvoker, highestAvailable, requireAdministrator. |
--set-requested-execution-level "requireAdministrator" |
--application-manifest <path-to-file> |
Set application manifest from an external XML file. | --application-manifest "./app.manifest" |
| Command | Description | Example |
|---|---|---|
--set-resource-string <id> <value> |
Set string resource by numeric ID. | --set-resource-string 104 "New String" |
--get-resource-string <id> |
Get string resource by numeric ID. | --get-resource-string 104 |
--set-rcdata <id> <path-to-file> |
Replace RCDATA resource by numeric ID using binary file contents. |
--set-rcdata 1 "./payload.bin" |
π‘ Why PyRcEdit?
The original rcedit tool is archived and requires a full C++ build environment.
PyRcEdit provides a modern, lightweight alternative:
- Pure Python implementation
- No compilation required
- Easy to automate
- Actively maintained
- Ideal for CI/CD pipelines on Windows
Why do I need to provide a full path to the executable? Win32 APIs used internally cannot reliably resolve relative paths.
Why did my .exe get corrupted? Some PE files use non-standard layouts. Always keep a backup.
Does PyRcEdit work on Linux or macOS? Not currently. It relies on native Windows APIs.
Contributions are always welcome! Please read our contribution guidelines first to get started.
If you discover a vulnerability, please follow our security guidelines
- Original approach and C++ implementation by the Electron team.
- This Python port brings frictionless, scriptable metadata modification to typical continuous integration (CI) workflows on Windows using Python.