Here is given the way to set password in any file at Windows 7 & Windows 8. To do these follow the steps:
Step-1: Click right button by keeping cursor on file or files which you want to set password.
Step 2: Click on Add to archive.
Step 3: Select Rar option from format and then click on set password option.
Step 4: Give password for two times to set password.
Step 5: Press Ok
Your password is set. If you want to open file then it will require password. After providing correct password your file will open.