Yes, I have the source code, but the program is so large as to publish the code on the forum.
The program is written in C, it searches for files by mask (and tracks the creation of new ones) and deletes / changes depending on the task. The problem is that it works from SYSTEM, but at the same time it cannot access the network shares. I see error - ERROR_NO_SUCH_LOGON_SESSION.
As far as I know, network drives are local to the user that connects them, meaning they are not (directly) visible to oth.er users. That also implies a network drive, e.g. Q:, can be mapped to place A for user X and to place B for user Y.