Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
Password protect any folder without any third party software?

I want to be able to lock any folder on my laptop so that it requires a password to open.

I'd like it to be an attribute that can either be set through the command prompt using the "ATTRIB" function, or in the properties window of that folder along with the "Hidden" and "Read-only" attributes.

I would assume that this requires me to edit the registry some how but I don't know what directory/key to edit.

I don't want to have to download any additional software to make this work, there should be a way of doing this on my own.

This probably isn't much to go by, but it's not a complicated question. I've dealt with the registry before when I added a few context menu options, changed my login screen, and changed default programs for file extensions.

EDIT 1:

Are you sure there isn't a way to do this through the registry?

I know you can add features to the context menu, the login screen, file types and associations... and just to be clear when I said I don't want third party programs/software I meant like, programs that are required in order for this to be functional.

If there is a program out there that can add this feature and then be deleted I'd be interested. And when I say "lock the folder", I mean set a password on it in general, no for specific users, so that when I click on it it brings up a window asking for authentication of some sort. maybe add a registry key that opens a vb.net login form when the folder is clicked?

Any information would help, Thanks!

share|improve this question

migrated from stackoverflow.com Aug 29 '11 at 13:01

This question came from our site for professional and enthusiast programmers.

marked as duplicate by techie007, Hennes, CharlieRB, TFM, akira Nov 22 '12 at 7:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
    
Yes; there is no way to do this using the registry. –  SLaks Aug 29 '11 at 13:17
    
read my comment on rook's answer below –  Daniel Jewison Aug 29 '11 at 13:22
add comment

2 Answers

You need to set the permissions of the folder so that only your user account has read access.
This way, no other users will be able to browse the folder.

If there are other users with administrative privileges, you can encrypt the folder (in Properties, Advanced) to prevent them from reading it even if they take ownership.

Make sure your user account has a strong password.

share|improve this answer
    
I don't think that's what he's asking. (Could be wrong though). –  Rook Aug 29 '11 at 13:03
1  
@Rook: It might not be, but it's what he should be asking for. (IMHO) –  SLaks Aug 29 '11 at 13:05
    
read my edit above –  Daniel Jewison Aug 29 '11 at 13:16
    
@SLaks - "what he should be asking for" ??! That's going a bit high, isn't it? –  Rook Aug 29 '11 at 15:30
add comment

AFAIK, there is no way to do this using Windows build in features. ATTRIB (file/folder attribute) enables you to change the read-only / hidden / attribute status, but it does not enable you to encrypt the folder or to deny access to it.

Do you have in mind of writing your own software for doing this maybe?


No, there isn't a way to do it through the registry. (Registry is irrelevant here; Windows don't have file/folder encryption capabilities).

You can however try to find a portable (that doesn't require installation) version of some encryption program maybe, and have it encrypt the folder. By putting file association to that program you can accomplish click&run feature.

Notice, this is purely speculation - I've never messed with anything of the sort, so don't have any concrete examples with me. But IMHO, it will be so much harder than just installing a program specifically build for that purpose.

share|improve this answer
    
read my edit above, and yes id be willing to write a login form in vb.net and then bind it to a folder using the registry somehow... maybe the registry key could open a batch file with something like: "if selected folder = "foldername" then start vb_login_form.exe" in it to identify which folder is to be locked. –  Daniel Jewison Aug 29 '11 at 13:16
    
trust me ive looked high and low for a program that can do this without a messy and complicated gui to go through. id be willing to write my own but im not sure where to begin. –  Daniel Jewison Aug 31 '11 at 15:03
    
@Daniel - Wait a minute. Are you saying you're looking for a command line program (I didn't see it mentioned in the question). If not, googling for "password protect a folder portable" gives several options. Some of them are portable as far as I can see. –  Rook Aug 31 '11 at 15:20
    
I'd advise against writing your own, unless you know what you're doing in advance. –  Rook Aug 31 '11 at 15:20
    
a command line program could be an option, the only reason i wanted to have this as an attribute is for easy access, i wanted to be able to quickly lock a folder without having to flick through a bunch of windows and tabs, or have to wait for a really big program to load. and if it can be done in vb.net then i won't have much of a problem. or even vbscript would be nice. i was thinking about a different extension all together like my own lockable folder shell but idk much about that kind of thing. (although it would give me more flexibility.) –  Daniel Jewison Aug 31 '11 at 15:26
show 7 more comments

Not the answer you're looking for? Browse other questions tagged or ask your own question.