-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File Locksmith - command line version #28529
Comments
I needed this acutely, so I added it to my fork ( https://github.com/lwahonen/PowerToys ). I'm happy to help get this merged upstream. Usage: "PowerToys.FileLocksmithUI.exe" <options> <files> Options implemented: /list Dump all current locks to the console For example |
Ended up making a separate project for the console tool, updated my repo. Not sure how to get the ConsoleSmith.exe packed in the installer, but I'm happy to work with someone more knowledgeable |
I would see if we couldn't just do this inside the UI and maybe adjust the UI exe name personally. Big feedback here would be to if there is an alternative to "kill" |
As I said in the other issue: Offering a command-line interface from a program built with subsystem:windows is a headache. You can reattach to the console that started you, but that still breaks things such as piping the output to a file - and scripts often redirect output of tools for reporting / further processing. I'm very happy if someone has a magic trick in their back pocket that can be used to: -Not show an extra console window when the application is started via icon As to your other point, I'm happy to rename the command. Would terminate work better? That seems to be the term often used in Win32 APIs such as TerminateThread |
Push it out the door the world needs it! |
I'm waiting for @crutkas to either suggest a way to integrate the command-line to the existing UI, or accept that the CLI is a separate tool. |
@Langenbacher,
Would they work for you? |
Moving discussion to PolarGoose/Handle2#2 |
/dup #22315 |
Hi! We've identified this issue as a duplicate of another one that already exists on this Issue Tracker. This specific instance is being closed in favor of tracking the concern over on the referenced thread. Thanks for your report! |
Description of the new feature / enhancement
Make a command line version of file locksmith so it can be use in batch files.
Scenario when this would be used?
I have a batch file to open an excel file, but only if it is not already open.
And after I open the excel file, my batch file waits for it to finish before doing more stuff.
because of the quirky way excel works when it has multiple files open, neither "start /wait" nor C:\Windows\System32\tasklist.exe can do the job.
Supporting information
"C:\Windows\System32\openfiles.exe /query" takes way too long.
"lsof" is a command in various flavors of unix that is like what I want.
https://man7.org/linux/man-pages/man8/lsof.8.html
Lot's of other people want this too, as google will show you.
https://www.google.com/search?q=how+to+check+from+command+line+if+a+given+file+is+open+by+any+process
The text was updated successfully, but these errors were encountered: