| Crates.io | desktop-ini |
| lib.rs | desktop-ini |
| version | 0.1.5 |
| created_at | 2025-12-11 13:01:55.258548+00 |
| updated_at | 2025-12-13 13:46:05.273258+00 |
| description | Modify directory's desktop.ini file. |
| homepage | |
| repository | https://github.com/ZIDOUZI/desktop-ini |
| max_upload_size | |
| id | 1979611 |
| size | 91,949 |
A small CLI tool for working with directory desktop.ini files on Windows.
It helps you inspect and edit desktop.ini fields, manage tags, configure custom execution commands, and sync folder attributes.
desktop.ini and show a concise, human-friendly summary.desktop.ini, with optional second confirmation.
desktop.ini, making the folders read-only.There is also a Chinese README: README_zh.md.
# From the project root
cargo install --path .
After installation, the compiled binary (usually named desktop-ini, depending on your environment) will be placed in Cargo's bin directory.
All subcommands share these global options:
--path <DIR>: Target directory. Defaults to the current working directory.--error-action <MODE>: Error handling strategy, one of:
continue: Print error and continue (default).inquire: Pause on error and wait for Enter.silently: Ignore errors without printing messages.stop: Abort immediately on error.--dry-run: Simulation mode. Print what would be written, but do not actually modify files or attributes.desktop-ini show --path <DIR>
Prints a compact summary of the desktop.ini contents, including:
LocalizedResourceName)IconResource)desktop-ini set \
--path <DIR> \
--name "Example folder" \
--icon "shell32.dll,4" \
--info-tip "This is an example" \
--add-tag work --add-tag rust \
--command "code" \
--args "%1" \
--confirm
Common options:
--name: Set directory display name (LocalizedResourceName).--icon: Set icon (IconResource), for example "shell32.dll,4".--info-tip: Set hover text (InfoTip).--add-tag / --remove-tag / --clear-tag: Manage tags stored in Prop5.
--add-tag / --remove-tag.--add-tag and --remove-tag also accept comma-separated values.--command: Set the executable (Target) for custom execution.--args: Set arguments (Args) for custom execution.
--args.%1 will be replaced with the directory path that contains desktop.ini.%% for a literal %.\" and \\ are supported.--confirm: Enable second confirmation before running the command.
Use --dry-run to preview changes and the final desktop.ini content without actually writing.
desktop-ini run --path <DIR>
y/yes: Execute the command.n/no: Do nothing and exit.o/open: Open the folder in Explorer and exit.f/file: Open desktop.ini using Explorer and exit.Target is configured in desktop.ini, the command simply returns without doing anything.Args is parsed using whitespace splitting + quotes grouping, with %1/%% expansion.740 (elevation required), it will trigger a UAC prompt and retry via ShellExecuteW.desktop-ini sync --path <ROOT> --depth <N>
ROOT. For each directory that contains desktop.ini, set the folder itself to read-only.--depth controls the maximum recursion depth. If omitted, the depth is effectively infinite.--dry-run to see how many folders would be affected without applying changes.desktop-ini setup
Creates a custom directory class under the current user's registry:
Software\Classes\INI.CustomExecution (name controlled by the DIRECTORY_CLASS constant).Shell\open\command to the current executable's run subcommand.Once this is configured, you can use DirectoryClass=INI.CustomExecution plus a [.CustomExecution] section in desktop.ini to have Explorer invoke this program when opening that folder.
desktop-ini completion | Out-String | Invoke-Expression
For example, this generates a PowerShell completion script and loads it into the current session. Write this into $PROFILE to make it permanent.
# Run tests
cargo test
# Build the project
cargo build
Main dependencies:
clap / clap_complete: CLI parsing and completionsowo-colors: colored terminal outputencoding_rs: read/write text using the system ANSI code pagethiserror: error type definitionswinreg: Windows registry accesswindows-sys: Windows API calls