There's about a million ways to do this. If you want something really simple(and not that secure) you can google "password protecting a folder" and you will find all sorts of batch scripts and such to achieve that. If you want something still simple, but a little more heavy duty, you can use truecrypt(if you trust it).
Otherwise if you are using linux you should look up cryptoloop, EcryptFS, EncFS, and so forth. There's countless options.
EDIT: If all you are trying to do is safely store passwords, then I recommend KeepassX. Look it up.