Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Locking a folder

grarungrarun Posts: 40Member
Please tell me How can I lock a folder(Platform - Windows) with a password. What is the concept behind it.

Comments

  • GenjuroGenjuro Posts: 913Member
    : Please tell me How can I lock a folder(Platform - Windows) with a password. What is the concept behind it.
    :

    The concept is that you don't. Windows doesn't allow locking files with a password.
    You *could* perform a similar thing writing a FileSystem Filter Driver - this means C, assembler, the Driver Development Kit, the whole collection of artistic curse words that come with it, and perhaps a few extras.
    I have few words to say about the DDK: as far as I'm concerned, I won't mess with it ever again (and I'm not that easy to discourage).

    Another way to do so would be zipping files into a password-protected ZIP file. There are plenty of .DLLs around that do so. It's easy to implement, at least, despite probably not being the best way.

    The Windows way, however, relies on security and ACLs.
    Since the moment you log on a PC with Windows, you have a username which identifies you, you can have ownership of files and folders, and you can ask the system to not let anyone besides you into a folder.
    While the folder isn't password-protected by itself, anyone without your password wouldn't even be able to look into it if you set security right. As a side note, ACL APIs have a few COM interfaces VB can use (I know they exist, at least, but I haven't ever used them).
  • melissa_may1melissa_may1 Posts: 937Member
    : : Please tell me How can I lock a folder(Platform - Windows) with a password. What is the concept behind it.
    : :
    :
    : The concept is that you don't. Windows doesn't allow locking files with a password.

    Ummmm... Have you looked at Win NT, Win2K, Win 2K3, etc? They all allow password protected files and folders...

    So, the correct answer is "Some versions of Windows do allow password protected files and folders."


    [purple]Melissa[/purple]

  • BitByBit_ThorBitByBit_Thor Posts: 2,444Member
    : : : Please tell me How can I lock a folder(Platform - Windows) with a password. What is the concept behind it.
    : : :
    : :
    : : The concept is that you don't. Windows doesn't allow locking files with a password.
    :
    : Ummmm... Have you looked at Win NT, Win2K, Win 2K3, etc? They all allow password protected files and folders...
    :
    : So, the correct answer is "Some versions of Windows do allow password protected files and folders."
    :
    :
    : [purple]Melissa[/purple]
    :
    :

    The newer versions of Windows work with Access Rights.
    It's not the same as Password-locking a folder. Windows locks it from users and you have to log on as another user to access the directory.
    So there is a difference between them. An application can't just log on as another user, can it?
    I think the application can get at max the rights the user can, unless it is run as a another user.
    Therefor, even if you do know the password, you still need to switch users.
    To actually be safe, your program would have to create a special Admin account for itself...

    Conclusion: Not in Windows unless you want to seriously hack in to it.

    Greets...
    Richard

  • melissa_may1melissa_may1 Posts: 937Member
    Hi Richard:

    I guess we're using different definitions here...

    In Win NT, Win2K, etc. a user (owner) can restrict access (protect) a file or folder with a password. At that point, or later, the user (owner) can also grant access to any number of additional users. Further, the user (owner) can restrict the access that any user can have - read only, write, etc.

    A program running by any user has only the level of rights granted to that user. There's no need to "switch users" or "run as another user, or "create a special Admin account for itself."

    The user (owner) can also create a group of users, and assign access to the group as a whole, or to the group with exceptions to individual users.

    As fas as I can tell, this all falls under the heading of the original question, that of "protecting" a file or folder.

    That all said, there are other ways to do this, even with Win9x. If the Win9x machine is set up to share a folder or file, the user can set a username/password to that share. So, if the Win9x has physical restrictions (i.e. it's locked up), then other users - on any Windows OS- can only gain access to that file or folder by using the password.

    There are also utility programs that can be installed in Windows that will restrict/secure particular files or folders.

    All this without "seriously hacking" Windows...




    [purple]Melissa[/purple]

  • BitByBit_ThorBitByBit_Thor Posts: 2,444Member
    : Hi Richard:
    :
    : I guess we're using different definitions here...
    :
    : In Win NT, Win2K, etc. a user (owner) can restrict access (protect) a file or folder with a password. At that point, or later, the user (owner) can also grant access to any number of additional users. Further, the user (owner) can restrict the access that any user can have - read only, write, etc.
    :

    I haven't seen that ability anywhere. I know you can set user access restrictions on a folder (concerning access rights) but I have never seen any option where you can secure a directory with a password.

    : A program running by any user has only the level of rights granted to that user. There's no need to "switch users" or "run as another user, or "create a special Admin account for itself."
    :

    This will only be necessary if you can only restrict it from other users. If you don't mind having the folder unlocked to the current user, but only to other users, then this will work fine if the current user is Admin and there won't be any need for switching users or creating a new account.


    : The user (owner) can also create a group of users, and assign access to the group as a whole, or to the group with exceptions to individual users.
    :

    Yes, and then we are talking about access rights for users. Seems we both have a different vision on the question. I read it like "I have a user account and I want to restrict this user from being able to access a directory unless he/she enters the correct password"
    This can not really be done...
    You are probably reading it like "I want to lock a personal directory from other users". No problem if the current user is admin. If the user isn't, I think it is not possible.

    : As fas as I can tell, this all falls under the heading of the original question, that of "protecting" a file or folder.
    :

    Protect yes, but only from other users...

    : That all said, there are other ways to do this, even with Win9x. If the Win9x machine is set up to share a folder or file, the user can set a username/password to that share. So, if the Win9x has physical restrictions (i.e. it's locked up), then other users - on any Windows OS- can only gain access to that file or folder by using the password.
    :

    Wouldn't know about Win9x ;-)

    : There are also utility programs that can be installed in Windows that will restrict/secure particular files or folders.
    :
    : All this without "seriously hacking" Windows...
    :
    :

    Well... I wonder how these utilities protect a directory. I hope these won't have to be running all the time?

    Nice discussion indeed!

    Greets...
    Richard

Sign In or Register to comment.