How to preven Files Copying and deleting From Within Vfp ?

Posted on 2004-10-27
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

    Expert Comment

    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

    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

    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 ??
    LVL 19

    Expert Comment

    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

    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

    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

    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

    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.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Course: Foundations of Front-End Development

    Jump-start a lucrative career in front-end web development, with zero previous coding experience required. This course covers the basic programming concepts and languages required for creating engaging websites from scratch.

    Suggested Solutions

    Title # Comments Views Activity
    Help with my python script 6 118
    wait notify demo infinite loop 3 57
    java ^ examples 8 41
    Sql how to exclude from a table 3 51
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    845 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now