# Wild idea: custom column and dialog to show what locks a file

**URL:** <https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883>\
**Category:** Help & Support\
**Created:** [March 18, 2026, 12:10pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883 "2026-03-18T12:10:42Z")\
**Posts on this page:** 19\
**Page:** 3

<div class="post-metadata">

**Author:** ![PolarGoose](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/4491bb/32.png) [@PolarGoose](https://resource.dopus.com/u/PolarGoose)\
**Post date:** [March 24, 2026, 12:00pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/43 "2026-03-24T12:00:02Z")

</div>

Current progress. The code works. It shows the locked status almost instantaneously. Even a folder like `C:\Windows\System32` is tolerable, even though there is a huge amount of files. The only drawback is that the info is about 8-10 seconds out of date: it takes 3 seconds to get all handles and modules in the system, and I added a 5 second sleep between updates to avoid spamming the CPU.

 ![Screenshot 2026-03-24 125357](https://resource.dopus.com/uploads/default/original/3X/e/4/e4e7e180826b99db3403e7fc26be6ee389fd2f90.png)

---

<div class="post-metadata">

**Author:** ![jfour18](https://resource.dopus.com/user_avatar/resource.dopus.com/jfour18/32/66032_2.png) [@jfour18](https://resource.dopus.com/u/jfour18)\
**Post date:** [March 24, 2026, 12:20pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/44 "2026-03-24T12:20:52Z")

</div>

I suspect most PC's aren't as fast as yours but I don't think time delays matter much for this kind of thing.

---

<div class="post-metadata">

**Author:** ![PolarGoose](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/4491bb/32.png) [@PolarGoose](https://resource.dopus.com/u/PolarGoose)\
**Post date:** [March 24, 2026, 2:04pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/45 "2026-03-24T14:04:09Z")

</div>

> I suspect most PC's aren't as fast as yours but I don't think time delays matter much for this kind of thing.

Yes, but it still will be fast to show the data. Only background loop that updates the cache will be slower. 99% of the time you want to delete a file that was locked for more than 10 seconds.

---

<div class="post-metadata">

**Author:** ![errante](https://resource.dopus.com/user_avatar/resource.dopus.com/errante/32/61692_2.png) [@errante](https://resource.dopus.com/u/errante)\
**Post date:** [March 24, 2026, 3:11pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/46 "2026-03-24T15:11:56Z")

</div>

> [@PolarGoose](#):
>
> What is your approach for the script?

Sorry for being away, I'd accumulated work to do.  
For me, it would mostly be used in "Command mode": a dialog that lets you do the most common things you might want to do with a locked file (unlock it, schedule delete/move, etc).

The last version I made this past Sunday basically follows this approach:  
For information only (columns), it grabs a list of all locked files for all processes (within allowed permissions). Then it simply checks whether a specific file is on that list and shows some info about it. This works well with how user columns work in Opus. For a more complete list, you may need admin privileges (which is a configurable toggle).

There's also an infotip-only column that can query the info just for the item in question. The good thing about this is that you don't need admin privileges.

The "command mode" works as a server (basically, the Python part creates a local server). That's because if you ever need to elevate privileges, it will only ask once per command call, instead of asking for every task that requires elevation. Several "clients" can then use that server, so the UAC prompt will only show once. And every client sends a heartbeat on a timer; if no heartbeat is received for 30 seconds, the server auto-closes.

> [@PolarGoose](#):
>
> Current progress. The code works. It shows the locked status almost instantaneously.

That does look really good indeed. But does that mean it's constantly running and gathering data, am I right?  
What does the "more" value mean? That the "Windows" folder is locked by 281 processes (very unlikely), or that the folder also contains at least 280 items that are also locked?

---

<div class="post-metadata">

**Author:** ![PolarGoose](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/4491bb/32.png) [@PolarGoose](https://resource.dopus.com/u/PolarGoose)\
**Post date:** [March 24, 2026, 3:21pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/47 "2026-03-24T15:21:55Z")

</div>

> [@errante](#):
>
> But does that mean it's constantly running and gathering data, am I right?

It does only if Opus is opened and created my C++ COM class. Otherwise, nothing happens. You don't pay for what you don't use.  
However, if you open Opus that uses my C++ COM class and it runs in the background, then every 5 seconds, the cache will be updated.  
It is similar to `Search Everything`: it always updates its cache, even if you don't use it.

> What does the "more" value mean? That the "Windows" folder is locked by 281 processes (very unlikely), or that the folder also contains at least 280 items that are also locked?

It means "there are another 250 processes locking this folder". I just can't display the full list inside the column. Thus, I show only 1. In my case, it is actually true. I have a huge amount of processes for some reasons 🙂 And it includes processes that run as an admin and a System user.

By the way by "locking a folder" I mean:

- A process literally locks a folder (f.e. you open Powershell inside a folder)
- A process locks some file inside this folder recursively

---

<div class="post-metadata">

**Author:** ![errante](https://resource.dopus.com/user_avatar/resource.dopus.com/errante/32/61692_2.png) [@errante](https://resource.dopus.com/u/errante)\
**Post date:** [March 24, 2026, 4:11pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/48 "2026-03-24T16:11:39Z")

</div>

Interesting. I'm not familiar with `SearchEverything` (is [this](https://resource.dopus.com/t/searcheverything-getting-opus-to-work-with-everything/8894) utility?).  
But does your implementation have a way to explicitly ask it to close? That could be helpful, if possible of course.

---

<div class="post-metadata">

**Author:** ![PolarGoose](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/4491bb/32.png) [@PolarGoose](https://resource.dopus.com/u/PolarGoose)\
**Post date:** [March 24, 2026, 4:57pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/49 "2026-03-24T16:57:48Z")

</div>

> does your implementation have a way to explicitly ask it to close?

Right now, not. But it is very easy to add. Now I just want to make something work. I will add it to the to-do list.

> SearchEverything

Sorry, I meant this [voidtools Everything](https://www.voidtools.com/)

---

<div class="post-metadata">

**Author:** ![PolarGoose](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/4491bb/32.png) [@PolarGoose](https://resource.dopus.com/u/PolarGoose)\
**Post date:** [March 24, 2026, 6:33pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/50 "2026-03-24T18:33:28Z")

</div>

> Those seem like GitHub problems rather than C++ ones. GitHub has a lot of flaws.

Want to add:  
It is more of a C++ ecosystem issue, because the package manager `vcpkg` made by Microsoft doesn't support Windows properly 🙂

---

<div class="post-metadata">

**Author:** ![PolarGoose](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/4491bb/32.png) [@PolarGoose](https://resource.dopus.com/u/PolarGoose)\
**Post date:** [March 25, 2026, 5:39pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/51 "2026-03-25T17:39:45Z")

</div>

It is happening. I have created a custom dialog and columns. I will release it soon.

 ![image](https://resource.dopus.com/uploads/default/original/3X/2/b/2b48be800d253085cd0fdd4da96eee143453769f.png)

---

<div class="post-metadata">

**Author:** ![PolarGoose](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/4491bb/32.png) [@PolarGoose](https://resource.dopus.com/u/PolarGoose)\
**Post date:** [March 27, 2026, 2:22pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/52 "2026-03-27T14:22:09Z")

</div>

My project is maybe 1000 lines of code. It is not much, mostly boilerplate. But it takes 4 hours to build on a beefy GitHub Actions machine. It is C++ for you 🙂 (it is because of 3rd party libraries)

---

<div class="post-metadata">

**Author:** ![PolarGoose](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/4491bb/32.png) [@PolarGoose](https://resource.dopus.com/u/PolarGoose)\
**Post date:** [March 27, 2026, 2:25pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/53 "2026-03-27T14:25:21Z")

</div>

No machine is powerful enough. There is a whole company [Incredibuild](https://www.incredibuild.com/) that earns a lot of money just because C++ is so painfully slow. You literally have to have a cluster of 100s of machines just to make code compile in a reasonable time 🙂

---

<div class="post-metadata">

**Author:** ![Leo](https://resource.dopus.com/user_avatar/resource.dopus.com/leo/32/69732_2.png) [@Leo](https://resource.dopus.com/u/Leo)\
**Post date:** [March 27, 2026, 3:04pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/54 "2026-03-27T15:04:54Z")

</div>

C++ can build very quickly. Opus and its dependencies are _millions_ of lines of C/C++ code and headers but compile in only 1m30s (debug) or 04m43s (optimized/release) on a 9950X3D (16C/32T).

Precompiled headers help _a lot_, FWIW.

---

<div class="post-metadata">

**Author:** ![PolarGoose](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/4491bb/32.png) [@PolarGoose](https://resource.dopus.com/u/PolarGoose)\
**Post date:** [March 27, 2026, 3:47pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/55 "2026-03-27T15:47:09Z")

</div>

> C++ can build very quickly. Opus and its dependencies are millions of lines of C/C++ code and headers but compile in only 1m30s (debug) or 04m43s (optimized/release) on a 9950X3D (16C/32T).

Wow. This is actually impressive. Great job.  
Yes, I use precompiled headers.  
But what I wrote is partly a joke. In my case, it is just the 3rd-party dependencies that take so much time. `vcpkg` compiles them from scratch, and I actually think it does so very inefficiently, because it recreates the build environment for every package.  
But only the from-scratch builds are that bad. Incremental builds are fast.  
If you don't have heavy 3rd party dependencies, then the speed will be fast, but honestly, still impressive in your case, how fast you manage to build such a huge app.

---

<div class="post-metadata">

**Author:** ![jfour18](https://resource.dopus.com/user_avatar/resource.dopus.com/jfour18/32/66032_2.png) [@jfour18](https://resource.dopus.com/u/jfour18)\
**Post date:** [April 2, 2026, 4:11am UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/56 "2026-04-02T04:11:22Z")

</div>

Given that you expose the PID's, it occurs to me that this is a good opportunity for targeted on demand memory scanning using PE-sieve or Hollows Hunter. I have attached a slightly modified version of your script that uses Hollows Hunter to do this. Just proof of concept/not polished.

[DirectoryOpus-FileLockingInfo-columns-and-dialog.opusscriptinstall](https://resource.dopus.com/uploads/short-url/kgTtAssCOPpUNTS5SM0fkb32Kc.opusscript) (3.9 KB)

---

<div class="post-metadata">

**Author:** ![PolarGoose](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/4491bb/32.png) [@PolarGoose](https://resource.dopus.com/u/PolarGoose)\
**Post date:** [April 2, 2026, 1:23pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/57 "2026-04-02T13:23:58Z")

</div>

Interesting.  
What does it do?

---

<div class="post-metadata">

**Author:** ![jfour18](https://resource.dopus.com/user_avatar/resource.dopus.com/jfour18/32/66032_2.png) [@jfour18](https://resource.dopus.com/u/jfour18)\
**Post date:** [April 2, 2026, 1:44pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/58 "2026-04-02T13:44:47Z")

</div>

It is a command line memory scanner for finding suspicious code injected into running processes. Ordinarily it scans the entire system which can be slow, but if you are only concerned that a specific program/process might be malicious, it is helpful to just be able to only scan the processes touching that particular file. It basically detects indicators of compromise for running processes. It is useful for detecting fileless malware or packed executables etc. As applied here, I just pass all of the pids touching a particular file to hollows hunter and it shows whether any of them are concerning and why. This is uniquely helpful because most antivirus programs are weak in this particular domain. It is something that needs to be done on demand and being able to do it in such a targeted way is actually quite unique since you need to pass pids rather than paths, which makes anything other that system wide scans awkward, but your approach actually gives a helpful way of making it less so.

There are convenient ways of doing it at the system level like hollows hunter, Thor-lite, and loki-rs, but that takes too long for my liking. It also produces a lot of noise, by flagging processes that you know are benign, and that are completely unrelated to your concern.

---

<div class="post-metadata">

**Author:** ![errante](https://resource.dopus.com/user_avatar/resource.dopus.com/errante/32/61692_2.png) [@errante](https://resource.dopus.com/u/errante)\
**Post date:** [April 3, 2026, 11:12pm UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/59 "2026-04-03T23:12:32Z")

</div>

I realized something. It's true that trying to get this kind of information in a fully complete way is kind of a lost cause. But then I saw that, thanks to the amazing work by @PolarGoose, who basically did all the heavy lifting, you can now use the driver directly even from a Python script.

And that's also when I understood why you chose to keep a constantly updated cache.

Since my user case is kinf of recreational, I implemented it like this: there's a service (written in Python) that handles the heavy work, and a bridge (also in Python) that takes care of communication between the service and Opus. Even though the service can run in the background all the time, it doesn't cache continuously, so that's not an issue anymore.

Whenever Opus ask for the data, it gets cached (e.g. for 5 seconds). For columns, this works well for me, since I can get fresh data in about 3 seconds.

When using the dialog, the service runs a server. In that case, it does continuously cache the data, but only while the server is active (the service auto-detects this once there are no more clients connected). With this, I've effectively solved the constant CPU usage I had with the original plugin.

Thanks a lot for your great work and more importantly to share this with others.

---

<div class="post-metadata">

**Author:** ![PolarGoose](https://resource.dopus.com/letter_avatar_proxy/v4/letter/p/4491bb/32.png) [@PolarGoose](https://resource.dopus.com/u/PolarGoose)\
**Post date:** [April 4, 2026, 10:57am UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/60 "2026-04-04T10:57:59Z")

</div>

Interesting approach. Good job on making this work in Python.

---

<div class="post-metadata">

**Author:** ![Jon](https://resource.dopus.com/user_avatar/resource.dopus.com/jon/32/12713_2.png) [@Jon](https://resource.dopus.com/u/Jon)\
**Post date:** [April 17, 2026, 5:43am UTC](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883/61 "2026-04-17T05:43:33Z")

</div>

Just a heads up that this script will error in 13.22.5 because of this change:

> Improved the checks Vars.Set() does to detect non-Opus objects (they are not supported in Vars objects as they can easily cause crashes, since they can't persist from one instance of a script to another).

We previously checked for variables that were added directly to Vars and rejected non-Opus objects (e.g. jscript arrays), but we now also check for non-Opus objects hidden inside Opus ones (e.g. in a Vector).

Using jscript objects in a Vars object doesn't work reliably (and often crashes) because the objects are linked to the instance of the script engine that created them. Objects will remain in memory because of their refcount, but if the jscript garbage collector runs after that instance has shut down, the memory underlying them is released and the object now points to unallocated memory.

If you need to persist non-Opus objects from one instance of a script to another the only safe way is by serialising them (e.g. to JSON). Or e.g. use an Opus object like a Vector instead of a jscript array.

[Previous page](https://resource.dopus.com/t/wild-idea-custom-column-and-dialog-to-show-what-locks-a-file/58883.md?page=2)
