dcsimg
Results 1 to 8 of 8

Thread: Lock folder

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2008
    Posts
    1,260

    Lock folder

    I can lock a folder by using this code:

    Name "C:\test" As "C:\test" & ".{645FF040-5081-101B-9F08-00AA002F954E}"

    This changes the folders icon to the recycle bin icon. Am I able to change this icon to be a normal folder icon?

    Thanks

  2. #2
    Addicted Member reacen's Avatar
    Join Date
    Jul 2009
    Location
    c:\windows\system32\gdi32.dll
    Posts
    243

    Re: Lock folder

    Huh ?

    Code:
    Name "C:\test" As "C:\test" & ".{645FF040-5081-101B-9F08-00AA002F954E}"
    !=

    Code:
    Name  "C:\test" & ".{645FF040-5081-101B-9F08-00AA002F954E}" As "C:\test"
    ??
    DoEvents

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2008
    Posts
    1,260

    Re: Lock folder

    This is the best way i have found to lock a folder.

    Is there a better way?

  4. #4
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: Lock folder

    Its not working, because i can enter this folder by using total commander for example. Maybe you should look for some security related documentations to read more about how to protect/lock a file or folder.

    Look here is a simple way to lock a folder.
    http://support.microsoft.com/?scid=k...09531&x=10&y=9

    Regarding this article, the CACLS can be used to remove or grant the access for a user on a certain folder.

    c:>CACLS "c:\test" /E /D username
    this will lock the folder.

    c:>CACLS "c:\test" /E /G username:F
    and this will grant the access again.
    Last edited by Jim Davis; Oct 21st, 2009 at 12:06 AM.

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2008
    Posts
    1,260

    Re: Lock folder

    That is exactly what I am after Jim. Can you help me as to how I can do it via vb6. This is my code:

    Code:
    Shell "C:\windows\System32\cacls.exe C:\test calc /E /D USERS", vbNormalFocus
    Why wont this work?

  6. #6
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: Lock folder

    The username should be the valid username, the user is logged on.

    the C:\test calc should also be encapsulated between "brackets"

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Sep 2008
    Posts
    1,260

    Re: Lock folder

    Jim, is it possible to password protect a cacls folder? I dont see an option for this in its help.

    If not, are there other ways to lock a folder, with a password?

  8. #8
    Frenzied Member Jim Davis's Avatar
    Join Date
    Mar 2001
    Location
    Mars base one Username: Jim Davis Password: yCrm33
    Posts
    1,284

    Re: Lock folder

    i would say a no, because there aren't such options in windows explorer, that pops up a windows and ask for a password. well, at least i didn't see it so far. so why windows would let you to password protect a content, that it will be unable to open later? however you can password protect .zip packages for example. just zip the content (with password) and put it into the folder, delete the content, and lock the folder. your app will be responsible to closing/opening the access. but if a user gets the time to find the workaround to unlock this folder all he/she will find a password protected zip, that will be a second challenge.

    but it's better to look around the internet (use google that is fine) and find some tech articles regarding this thread. it took me 1 minute to find the above cacls way. but you could be more lucky than me, and find some better ways.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width