Results 1 to 2 of 2

Thread: [RESOLVED] File Attributes on secondary drive

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Location
    In my head
    Posts
    913

    Resolved [RESOLVED] File Attributes on secondary drive

    I know you can use windows to protect the files on your hard drives, understand that pretty well.....however, does it also carry over it you take a hard drive out and connect it to another machine without the same security setup? What I mean is will the security measures persist if the hard drive itself is switched out? How could you make this happen other than running encryption on each and every file.....and if the other computer is using encryption can you still open the files??

    Thanks,

    David

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: File Attributes on secondary drive

    Here's an option. This sample from AllAPI.net can encrypt a file or even a complete directory. If directory is encrypted, then only new files created in the same directory are also encrypted. So; create a new directory, encrypt it and copy everything you need to have encrypted into it. However, works only on NTFS and can be executed only on W2K or later:

    VB Code:
    1. Private Declare Function EncryptFile Lib "ADVAPI32" Alias "EncryptFileA" _
    2. (ByVal lpFileName As String) As Boolean
    3. Private Declare Function DecryptFile Lib "ADVAPI32" Alias "DecryptFileA" _
    4. (ByVal lpFileName As String, ByVal dwReserved As Long) As Boolean
    5.  
    6. 'to encrypt
    7. Private Sub Form_Load()
    8.     Encrypt "c:\myDir"
    9. End Sub
    10.  
    11. Sub Encrypt(sFile As String)
    12.     If EncryptFile(sFile) Then
    13.         MsgBox "Successfully encrypted!"
    14.     End If
    15. End Sub
    16.  
    17. 'to decrypt
    18. Private Sub Command1_Click()
    19.     Decrypt "c:\myDir"
    20. End Sub
    21.  
    22. Sub Decrypt(sFile As String)
    23.     If DecryptFile(sFile, 0) = True Then
    24.         MsgBox "Successfully decrypted!"
    25.     End If
    26. End Sub
    These files/directories are after encrypton accessible only to you. To test it, switch to another user and you'll get the idea. I think that when you'll encrypt your files/directories you wont be able to access theme on another computer.

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