Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


How to preven Files Copying and deleting From Within Vfp ?

Posted on 2004-10-27
Medium Priority
Last Modified: 2013-11-13
I'm a Visual FoxPro Programmer and I hope there are many Visual FoxPro Experts here. I really need a solution about "how to develop and application (utility) that can prevent users from copying or deleting a files ?" This is very new threat for me because I never deal with this kind of demand before. What about copyhook ? how to use it for preventing a copying or deleting of files ? Or there another solutions ?

Thank for All,

Question by:KristhianusHarefa
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2

Expert Comment

ID: 12422593
you cannot prevent someone from copying files due to the fact that most applications when written do not have access to the O/S  info on transfering files. Possibly deletions may be prevented but that would only be from creating a backup and replacing the file if it does not exist (kludge).

The best way to avoid this delete or copy is to create permission for the user who logged in. If under windows, you should set up an account that cannot delete or copy files from the target directory. This is easy enough to do. However if your application does this, then locking that down may pose a problem.

LVL 19

Expert Comment

ID: 12424063
What you are asking is not a VFP question at all. Why would I need VFP if I wanted to copy/delete files? File level security is OS's responsibility, and VFP has got nothing to do with it.

Probably you are referrening to protecting your own VFP data files. If that's what you mean, secure it at OS level. Do not keep your daata files in open where they can be easily found with the help of explorer.

I can recommend, put your data files on a hidden netwrok share protected with a username and password. Code your VFP application in such a way that it connects to the hidden share programmatically supplying password as required. Now compile your application and give the binary code to the users to run (do not give .prg files). This way your source code remains secure and no one gets to know where your data files are located.

As far as copy and delete is concerned, it HAS TO BE controlled at OS level, you can't do anything from VFP to prevent that. Even at the OS level, you may at most prevent deletion of files, but if you leave them in open (users can browse to a folder and see the files), they can certainly copy the files too.

For your kind of situation I'll recommnd putting your data files on a Windows NT/2000 system and access it through a hidden share.


Author Comment

ID: 12441451
Dear Baudspeed and Ranjeetrain.

Thank for comments

Thanks for baudspeed and Ranjeetrain, but the comment still not a solution
Actually, this demand come from a radio station which I support as database programmer. The Radio's manager has spent much time an resources to prevent his officials from copying the songs and another musical resources from the server computer. He has tried used NT server but the prolem still, "radio operators or another related divisi must has an access to read a files to been edit or play with such musical application like jazler or cooledit, so that the files copying or deleting cannot be controled."  If the hidden path applied, the software like jazler, etc could not retriaves a files interactively, this will make the problem.

Now the manager do not beliave any suggestion sounds like 'change the server', or 're-define your network', he only want to buy an utility that can controls the files copying and deleting by inputing a password.

Any one can help me to develop the utilty ?  If there an Vfp Experts, can we focused our discuss to WinApi32 or Com server ??
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 19

Expert Comment

ID: 12444178
What you are saying is ENTIRELY possible, if you use Window NT/2000. Probably you have not been able to convince people. I can help you do that. But possibly that is outside the scope of EE.

Expert Comment

ID: 12444729
I agree with Ranjeet, NT is designed for this specificly, you just have to administrate the privs on the folder from an admin account.
HOWEVER, if you want to go over the top and attempt to do this you are going to need some pretty intensive APIs etc. I honestly dont think it could work that way

But here is another solution. The radio station needs to run those music files. However, you dont want someone to copy them. Does a specific application run these files? if this application is the only app ont eh computer, you could 'lock up' the workstation using a combination of NT settings for the user account (ie take away tool bar, explorer etc) and then write an app that will sit invisible to capture CTRL+ALT+DEL>

However, i strongly advise you to do this with NT. Because it is a standard and it works, and the admin who someday may follow you will thank you for it.

Expert Comment

ID: 12444748
Just a small amendment. If someone really really really wants those MP3s there going to get them. Best make sure you hire honest people and keep them well paid.

Author Comment

ID: 12451052
Again, thanks for both RanjeetRain and Baudspeed

The problem is,
1. there were many of software of the station gets trouble when running on the nt platform. Cooledit, for example, will raise any noize and unexpected dalay on recorded voice.

2. too dificcult to amandement or to forbid a creative person, which is allways be a streotip of radio station operator.

3. there an experts here ? Totaly I'v got un-underrstanding, why nobody respons this demand with, for example, talking about copyhook or something "to the points." I always thanks for any comments but, I want an experts who can talk about shell, com server, winapis, etc which related to "how to prevent users from files copying and deleting ?"
LVL 19

Accepted Solution

RanjeetRain earned 2000 total points
ID: 12452665
Oh well, if you (or your users or your management or your administrators) struggle with NT and making CoolEdit work on it, I seriously doubt any of the technologies you listed above will find its way into their brain.

I have been using CoolEdit for 4/5 years now and I have used nearly all version of NT (even versions older than NT 4). I never ever faced a single problem with CoolEdit on NT. If your audio hardware driver is at fault, you can't blame OS for that.

In your situation, I will just use NT (or better) to manage security of files at OS level and be done with it.


Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A short article about problems I had with the new location API and permissions in Marshmallow
If you are a mobile app developer and especially develop hybrid mobile apps then these 4 mistakes you must avoid for hybrid app development to be the more genuine app developer.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Introduction to Processes

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question