You can tell who has a share open:
open computer management (right click my computer and select manage) then from the tree view on the left select:
system tools> shared folders> sessions
this lists who is accessing files through shares.
there is an SO answer about sdoing this programatically:
https://stackoverflow.com/a/2418657/359135
If you really wanted to take it further and you have the admin rights you could use this info to interrogate running processes on connected machines:
tasklist.exe /S SYSTEM /U USERNAME /P PASSWORD
http://www.watchingthenet.com/how-to-view-and-kill-processes-on-remote-windows-computers.html
I am not suggesting you do any of this.. more to highlight what would be required. I would run a server somewhere that received a open, close and ping notification from your app.
the ping notification would let you identify instances that had crashed, lost connectivity or for any other reason not sent a close notification to the server app.
I have seen this done just by having a table in a DB of open session that gets written to every minute or so. I don't know how this would work for millions of users but i have seen it working well for tens of users (up to about a hundred).
EDIT:
more on pinging..
if you have server side code you can actively look for missing pings, however I would be tempted to just use a DB table and add a where clause to your select when reading open sessions:
Select
*
FROM
Session
WHERE
LastPing > DATEADD(second,-60,Now())
and I would check for an old record on insert, so that you don't get lots of old rows hanging around.
EDIT: just to be clear if you used the crazy techniques listed at the start of this answer you would have no way of knowing that someone had copied the file to their machine locally and run it. If you make the program insist that it has a connection to a particular DB or server then you have much more control.