Results 1 to 8 of 8

Thread: Restricting access to a .txt file

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    104

    Restricting access to a .txt file

    Is there any way to make it so a .txt file can't be opened? Since there are no passwords in Notepad or Wordpad I wondered if there was some way to restrict access to opening them.

  2. #2
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877

    Re: Restricting access to a .txt file

    Originally posted by Darth Predator
    Is there any way to make it so a .txt file can't be opened? Since there are no passwords in Notepad or Wordpad I wondered if there was some way to restrict access to opening them.
    If you are using NTFS then you can set permission so that only you can have access to it. You could also try zipping the file and then assigning password to the zip file.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  3. #3
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    set its attribute to HIDDEN. it's hard to open what you can't see


  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    To fool the average user you can make a VBScript with the following code and put it in your windows directory:
    VB Code:
    1. MsgBox "Access Denied", vbCritical, "Windows XP"

    Then goto the registry and change the value in the following location:
    HKEY_CLASSES_ROOT\txtfile\shell\open\command

    To:
    wscript.exe %windir%\txt.vbs

    This will discourage the average user but its very easy to get around.

    P.s: Backup the rgistry before making changes and if you don't know that the regitry is, ignore everything I've just said.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    104
    Well yes I know what the registry is, although I am reluctant to go making changes in it after a recent experience in which doing so completely screwed things up.

    If you are using NTFS then you can set permission so that only you can have access to it.
    What is NTFS? Apparently something I don't have....
    Last edited by Darth Predator; Aug 21st, 2004 at 10:31 AM.

  6. #6
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Originally posted by Darth Predator
    Well yes I know what the registry is, although I am reluctant to go making changes in it after a recent experience in which doing so completely screwed things up.


    What is NTFS? Apparently something I don't have....
    NTFS is a windows File Format. Your hard disk is formated either in FAT16, FAT32 or NTFS. NTFS was introduced in Windows 2000 i think. So if you have Win2k or XP then you can convert your Hard Disk to NTFS. Ntfs lets you assign read/write/execute/view/edit/delete etc permission for each file or folder to a group or user.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jul 2004
    Posts
    104
    Ah, I see now that it says I am using NTFS. Could you tell me how to set this permission?

  8. #8
    Big D Danial's Avatar
    Join Date
    Jul 2000
    Location
    ASP.Net Forum
    Posts
    2,877
    Originally posted by Darth Predator
    Ah, I see now that it says I am using NTFS. Could you tell me how to set this permission?
    First of all make sure you are logged in as Adminstrator. Now right click on the Folder/File you want to protect, choose properties, Now you should see a tab called Security. Now only select the user you want to be able to open the file using add button, remove the rest of the user e.g Everyone, User if its there.


    If you dont see the Security tab, then open any folder, click on the Tools menu then "Folder Options", then go to View Tab, scroll down to the last item, and make sure "Use Simple File sharing" is unchecked.
    [VBF RSS Feed]

    There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.

    If I have been helpful, Please Rate my Post. Thanks.

    This post was powered by :

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width