Windows script to trace a file

Subbarao

Junior Member
Mar 5, 2014
1
0
0
Hi,

I need a shell script to trace the files. i need to get user id who all are opening the files. Files can be CSV, TXT, or PDF.

For eg, consider Excel, we wrote a macro, such that when ever a user opens the file, macro triggers event, inserts a record, which consists of user id and sheet name to the Database.

Now we need trace same for the CSV, TXT and PDF file type. Is there any mechanism to find out such things.

I would be glad if any one can help me on this.

Thank you.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Can anyone there write C++, C#, Visual Basic programs?

You could make everyone use a front-end application that lets them browse for files and then it logs the selection and opens the file.

To keep someone from just using Open in Adobe Reader, etc. you'd need to either encrypt / decrypt the files on open - close or maybe try something with Windows accounts and access rights where only your program runs with the rights needed to copy from the document folder.

Or, you could store the documents on a server like SharePoint and log all access on the server side,

Note: these approaches and your macro will not stop someone from using Save As in the application to make a copy of the file. So you can detect that they opened the file once but not that they saved a copy to a Flash key.

---

A step beyond that would be making it so only your viewing app is used to view the documents, either web-based like Office 365 and Google Docs, or using Office replacement components like Farpoint / ComponentOne Spread:
https://www.componentone.com/SuperProducts/SpreadStudio/

---

The next step beyond that is much more complicated and painful - writing a file system filter driver so you can hook into file operations like anti-virus software does:
http://msdn.microsoft.com/en-us/library/windows/hardware/gg462968.aspx
 

mikeymikec

Lifer
May 19, 2011
18,061
10,245
136
FWIW, depending on your version of Windows, you can set up file auditing then specify the files you want to audit and find the results in the Windows event security log.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
Yeah, if you need this kind of security you should probably move the files behind a wall. There are a couple of ways to listen for file system activity in Windows, but they are all subject to client-side tampering.
 

xantub

Senior member
Feb 12, 2014
717
1
46
an alternative is to put the files in a database (MySql or whatever), that way they are not in the file system so they can't be opened unless they access the database, and there you can have all sorts of logs/restrictions.
 

cytg111

Lifer
Mar 17, 2008
23,561
13,122
136
c#'s filesystemwatcher and sysinternals handle could perhaps make for a fast fix ?
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |