How can i lock a folder without any additional software?

1

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!

Daniel Jewison

Posted 2011-08-29T12:59:16.003

Reputation: 139

Question was closed 2012-11-22T07:03:21.487

Related question: Password protect any folder without any third party software?

– Mokubai – 2011-08-29T13:09:17.087

Yes; there is no way to do this using the registry. – SLaks – 2011-08-29T13:17:58.830

read my comment on rook's answer below – Daniel Jewison – 2011-08-29T13:22:56.550

Answers

2

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.

SLaks

Posted 2011-08-29T12:59:16.003

Reputation: 7 596

I don't think that's what he's asking. (Could be wrong though). – Rook – 2011-08-29T13:03:37.363

1@Rook: It might not be, but it's what he should be asking for. (IMHO) – SLaks – 2011-08-29T13:05:16.697

read my edit above – Daniel Jewison – 2011-08-29T13:16:57.883

@SLaks - "what he should be asking for" ??! That's going a bit high, isn't it? – Rook – 2011-08-29T15:30:31.480

0

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.

Rook

Posted 2011-08-29T12:59:16.003

Reputation: 21 622

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 – 2011-08-29T13:16:27.710

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 – 2011-08-31T15:03:17.783

@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 – 2011-08-31T15:20:10.277

I'd advise against writing your own, unless you know what you're doing in advance. – Rook – 2011-08-31T15:20:35.970

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 – 2011-08-31T15:26:27.890

@Daniel - A different extension? I don't follow. Encryption is not an attribute, it is a process done on a file or a complete folder. Its speed depends on the size of a folder. It is in general changing the contents of a folder; which attributes don't do. They are merely flags you set or unset. – Rook – 2011-08-31T15:52:12.957

by extension, i meant like my own type of folder. a file container so to speak. (like zip folders) if i can't add this feature to windows folders, then would it be possible to do something like that? oh, i thought that password protecting a folder was just a "flag" that can be enabled along with setting a password and then disabled by entering it. almost like needing a password to hide or unhide a folder using its "Hidden" attribute. – Daniel Jewison – 2011-08-31T16:19:19.480

@Daniel - Well, one of the safer possibilities (and it exists in command line mode) now that you've mentioned "zip" would be to RAR or ZIP or 7z it with a password. RAR has a very uncomfortable password to crack. – Rook – 2011-08-31T19:22:05.413

Interesting, so is there a way to add a context menu option that would move the selected folder into an archive and set a password? (or prompt the user for one) either way how do you lock a rar archive? i've tried but i can't do it... – Daniel Jewison – 2011-08-31T19:29:39.223

@Daniel - Uhmm, no. But you can protect a certain folder with a password. For what you described you need a dedicated program. – Rook – 2011-08-31T19:52:07.347

fair enough so could you explain how i can lock a folder with a password? – Daniel Jewison – 2011-08-31T20:01:22.723

@Daniel - Make two .bat files (or .cmd, whichever you prefer). Put them in PATH maybe. In the lock.bat you put a command to zip&pass-protect it, and delete the folder and all subfolders afterwards, and in the unlock.bat to unzip it and delete the archive afterwards. Here are the examples of command line usage for several popular archivers http://www.dotnetperls.com/7-zip-examples and http://www.codejacked.com/zip-up-files-from-the-command-line/ Depending on which one you use googling for (7-zip/rar/zip command line password protect) brings up specifics.

– Rook – 2011-08-31T20:21:32.507