Simplest way to lock two directories

What is the easiest way to lock two directories to prevent prying eyes from viewing confidential information?

Also, if I were to lock them, would they still be available to Excel and Word - to view, edit, and save documents in the future?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

JohnBusiness Consultant (Owner)Commented:
Right click on the two folders, select Properties, then Security, and restrict the folders to the Administrator (and System if it is there) and then just you. So do not remove any system type permissions, but remove Everyone if there, and select yourself. Excel and Word will honour these settings.  ... Thinkpads_User

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
 if you have a standalone PC with common user then let me give use a very simple & great script to protect & hide your directories ... without use of any software :)


1- make a new folder ( name it as you like )
2- inside this folder make a (.TXT ) file & copy the following inside it:

Quote: cls
title Folder Private
if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
if NOT EXIST Private goto MDLOCKER
echo Are you sure you want to lock the folder(Y/N)
set/p "cho=>"
if %cho%==Y goto LOCK
if %cho%==y goto LOCK
if %cho%==n goto END
if %cho%==N goto END
echo Invalid choice.
ren Private "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
echo Folder locked
goto End
echo Enter password to unlock folder
set/p "pass=>"
if NOT %pass%== password here goto FAIL
attrib -h -s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
ren "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" Private
echo Folder Unlocked successfully
goto End
echo Invalid password
goto end
md Private
echo Private created successfully
goto End

3- After u copy the command go to line ( 23 ) u will find "password here" Change to any password u want.
4- After that, save it as locker.bat (the txt file will change to an application file)
5- Now go back to the folder & u will find a this locker.bat file.
6- Click on it & u will find a new folder called Private.
7- Now copy what u want in it & after that go to locker.bat by clicking it, it will open and ask you if you want to lock your folder? Y/N ?
8- Type Y
9- If you want to UNLOCK your folder, go open locker.bat & type your password and the Private folder will be made visible again.

Tested and working :]

For that script though. Wouldn't you have to first go to that batch file and execute it in order to use the folder in word and excel like the question specified. Sounds like that would be a hassle. I would go with the security rights as mentioned earlier
Active Protection takes the fight to cryptojacking

While there were several headline-grabbing ransomware attacks during in 2017, another big threat started appearing at the same time that didn’t get the same coverage – illicit cryptomining.

gbmcneilAuthor Commented:
Thanks one and all for responding...

My concern about adeelg1's approach is:

1. That the two directories that I would like to lock already exist, and they are very large with numerous branches and sub-branches. It would really be impractical for me to create new directories for each and copy the files I want to protect under each.

2. That I'm concerned that I do not fully understand the BAT language code provided by adeelg1. As such, I am worried that if I were to make any changes, it is possible I couldn't get into these directories myself. Then I'd really be in trouble!

3. That Grasty86 (I like that name) has observed that I would have to execute the BAT file before I used Word and Excel.

4. And, that my experience using a BAT script is that they are not very pretty when they execute, opening a DOS window for a brief period. I'd like to preserve the clean operation of the programs I run regularly - as much as possible.

Does this sound like a consensus is emerging? Let me try thinkpads_user's approach and get back to you momentarily.
gbmcneilAuthor Commented:
Could adeelg1 explain what "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" is? There maybe something very useful here for others who are looking over our shoulders.
I think think pads security rights is the best and cleanest way to accomplish this
gbmcneilAuthor Commented:
thinkpads_user -

Are you suggesting that I setup logging on my computer with a password only allowing the Administrator and others named with Administrator powers from getting in? Right now, the Windows 7 system is wide open. There is no password, and I am the user who is automatically logged in.

I believe the fellow who installed Windows 7 gave me Administrator authority.
That changes things  for his suggestion to work you would need to have two accounts. Yours with a password on it. And another.

Then you would give your account Full control and give the other account no rights. Then they can't get to the folder
JohnBusiness Consultant (Owner)Commented:
I assumed you two users would have different userids. You really should for easy and good security. So you are the admin, my procedure works fine. The other user logs on and cannot see the folders you secured.

... Thinkpads_User
@ gbmcneil:

I mentioned that If you have COMMON USER then you can follow it too otherwise standard solution is as Thinkpads suggesting ....

The Control Panel's key is called [HKEY_CLASSES_ROOT\CLSID\{21EC2020-3AEA-1069-A2DD-08002B30309D}] and the ID is the last set of number after CLSID, in this case '{21EC2020-3AEA-1069-A2DD-08002B30309D}. This is an easy way launching programs in Control Panel.

Plz visit below link for more details;

gbmcneilAuthor Commented:
I increased the points and awarded you all equal shares.

Good job. All of you had something significant to contribute.

Hope to hear from you again.
JohnBusiness Consultant (Owner)Commented:
Thank you, and good luck going forward. ... Thinkpads_User
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 7

From novice to tech pro — start learning today.