Skip to content

Conversation

@shuaiyuanxx
Copy link
Contributor

@shuaiyuanxx shuaiyuanxx commented Dec 3, 2025

Summary of the Pull Request

This pull request introduces a new command-line interface (CLI) project for the File Locksmith module, enabling users to interact with File Locksmith functionality directly from the command line. The changes include project and build configuration, CLI implementation, and supporting code to integrate with the existing FileLocksmith library.

Commands and Options

Command / Option Alias Description
<path> N/A Required. One or more file or directory paths to check. You can specify multiple paths separated by spaces.
--kill N/A Terminates (kills) all processes that are currently locking the specified files.
--json N/A Outputs the results in structured JSON format instead of human-readable text. Useful for automation and scripts.
--wait N/A Blocks execution and waits until the specified files are released. The command will not exit until the files are unlocked.
--help N/A Displays the help message with usage instructions.

Usage Examples

1. Basic check (Human-readable output)

Check which processes are locking a specific file:

FileLocksmithCLI.exe "C:\Users\Docs\report.docx"

2. Check multiple files and output JSON

Check multiple files and get the output in JSON format for parsing:

FileLocksmithCLI.exe --json "C:\File1.txt" "C:\Folder\File2.dll"

3. Wait for a file to be unlocked

Block script execution until a file is released (useful in build scripts):

FileLocksmithCLI.exe --wait "C:\bin\output.exe"

4. Force unlock a file

Kill all processes that are locking a specific file:

FileLocksmithCLI.exe --kill "C:\LockedFile.dat"

PR Checklist

  • Closes: #xxx
  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

Signed-off-by: Shawn Yuan (from Dev Box) <[email protected]>
@shuaiyuanxx shuaiyuanxx marked this pull request as ready for review December 5, 2025 05:25
@shuaiyuanxx shuaiyuanxx requested a review from a team as a code owner December 5, 2025 05:25
Signed-off-by: Shawn Yuan (from Dev Box) <[email protected]>
Signed-off-by: Shawn Yuan (from Dev Box) <[email protected]>
Signed-off-by: Shawn Yuan (from Dev Box) <[email protected]>
@niels9001
Copy link
Collaborator

@shuaiyuanxx would you mind posting a table with the commands, aliases and what they do in the PR description? I can then use that for adding it to the docs :)

</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The built exe needs to be signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants