A COM DLL that provides FileLockingInfoProvider COM class that can be used by JScript scripts for Directory Opus.
This class provides information about processes that are locking a specified file or folder.
This is a standalone project. It doesn't require DOpus-Scripting-Extensions to be installed.
- Supports Windows 10 x64 or higher.
- Supports only the JScript scripting language. VBScript is not supported.
- Portable Directory Opus is not supported because the DLL requires installation using an MSI installer.
FileLockingInfoProvider.GetLockingProcessesmethod uses a cache that gets updated every 5 seconds. Thus, the information that you receive can be outdated.
- Also shows locked files located on network shares and mounted drives.
- Download the installer from the latest release and install it on your system
- After that, you can access the functionality from any JScript or DOpus script.
// Create an instance of the FileLockingInfoProvider COM class.
// When you create the first instance, it starts the background loop that updates the file locking database every 5 seconds.
var fileLockingInfoProvider = new ActiveXObject("DOpusScriptingExtensions.FileLockingInfoProvider")
// GetLockingProcesses retrieves the list of processes that are locking the specified folder or any file or folder inside it.
// The list of processes includes processes from all users, including Admin and System.
// It retrieves information from the cache, which is updated in the background every 5 seconds.
// Thus, it is very fast (takes about 1-2 milliseconds on my machine).
// It returns a SAFEARRAY, you can convert it to a JavaScript array.
// As a parameter, you can specify a folder or a file path.
var processInfos = new VBArray(fileLockingInfoProvider.GetLockingProcesses("C:/Windows")).toArray()
processInfos = new VBArray(fileLockingInfoProvider.GetLockingProcesses("C:\\Windows\\System32\\en-US\\svchost.exe.mui")).toArray()
for (var i = 0; i < processInfos.length; i++) {
var info = processInfos[i]
WScript.Echo("Pid: " + info.Pid) // Process ID
WScript.Echo("ExecutablePath: " + info.ExecutablePath) // Executable full name, f.e. "C:\Windows\System32\svchost.exe"
WScript.Echo("DomainName: " + info.DomainName) // Domain name of the user that is running the process, f.e, "NT AUTHORITY"
WScript.Echo("UserName: " + info.UserName) // User name of the user that is running the process, f.e, "UserName"
}The project consists of two parts:
- Windows Service
DOpusScriptingExtensions.FileLockingInfoProvider.WindowsService.exe- Runs automatically when Windows starts.
- Uses
PROCEXP152.SYSdriver to get information about all locked files and folders in the system and the processes that lock them. - Also takes into account loaded DLLs and memory-mapped files.
- Uses Google RPC to allow the Directory Opus process to access the service functionality.
- Running as a service allows getting information about all processes, including running as an Admin or System. For security reasons, only the list of processes and locked files is exposed. No other information can be requested from the service.
- COM DLL
DOpusScriptingExtensions.FileLockingInfoProvider.ComDll.dll- Gets loaded by Directory Opus when
new ActiveXObject("DOpusScriptingExtensions.FileLockingInfoProvider")is called. - Runs a background loop that updates the file locking database every 5 seconds. It calls
DOpusScriptingExtensions.FileLockingInfoProvider.WindowsServiceGoogle RPC interface to get the list of processes and their locked files.
- Gets loaded by Directory Opus when
Visual Studio 2026with HeatWave for VS2022 plugin.- Open
DOpusScriptingExtensions.FileLockingInfoProvider.slnusingVisual Studio 2026as an admin.
- Run
build.ps1script as an admin