How to Lock Or Hide A Folder, A File Or A Drive On The Computer

These days, hiding or locking a folder or file is probably something you will need if you use a computer that others use too.

A previous post has been written on this topic here but I have found a few other methods of doing such a thing, excluding download programs that can be easily accessible to others.

Here are five other methods:

Windows

Method 1 (the easy one)

    1. Click “Start”, “Run,” and then type cmd. When the command prompt opens type “CD C:\Test” (replace “Test” with the name of the folder you want to hide.)

    2. Now type “attrib file +s +h” and replace “file” with the name of the actual file name you would like to hide.

    3. Now, go back to C:\Test and look for your file or folder, it’s not there! You cannot find it through simply browsing around, through the command prompt, or even if you click “Show Hidden Files and Folders”.

    4. To find the folder and it’s contents again simply go back to the command prompt, type “CD C:\Test” (of course, again replacing “Test” with the name of the folder,) and then type “attrib filename -s -h”. You should now be able to find your file again!

Method 2 (this is where it starts to get slightly more difficult)

This method, unlike the previous one, hides an entire drive instead of individual files or folders:

(Before you ever use the registry I HIGHLY RECOMMEND backing up your registry with a tool similar to Registry Tool or CCleaner. You may as well use a manual method similar to this.)

    1. Go to “Start,” “Run,” and type regedit.

    2. When the registry editor loads, navigate to: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\
    Policies\Explorer

    3. Right click on “Explorer” and select “New” and “DWORD Value.”

    4. Name the value NoDrives and select “Decimal” as the base.

    5. In the value type the number that corresponds with the drive below:

    (E.g. If you would like to hide drive E, type 16. You may also hide multiple drives by adding the two numbers. E.g. If you would like to hide drives E and G, 16+64=80.)

    6. Now, after you restart your computer, you should not be able to see the drive.

Method 3

    1. Create a folder in a drive for easy access, e.g. C:. (Name it something related to the Control Panel, e.g. Users.)

    2. Create a new file in Notepad and copy and paste the following into it:

    ren Users Users.{21EC2020-3AEA-1069-A2DD-08002B30309D}

    3. Replace “Users” with the name of the folder you created and save the file as loc.bat.

    (You should now be able to see your folder and the loc.bat file, with the loc.bat in the same directory as the folder Not in it.)

    4. Now, right-click and create another text file. Copy and Paste the following into it:

    ren Users.{21EC2020-3AEA-1069-A2DD-08002B30309D} Users
    (Make sure to replace the word “Users” with the name of your folder.)

    5. Save it as key.bat.

    6. Now you should see the loc.bat and the key.bat files in the same directory as the folder you created.

    7. Now, all you need to do is double-click on the loc.bat file and the folder should have an icon that looks like the control panel. If you click on the folder it should redirect you to the Control Panel and thus you have locked the folder.

    8. Of course, to unlock it, simply double-click on the key.bat file and the folder should turn back into the folder you first created.

    lock files in windows

Method 4

This final method allows users to hide files in a JPEG image:

hide files in JPEG

    1. Create a folder in C:\, e.g. C:\Folder1.

    2. Put all the files you want to hide in there, as well as a JPEG image that you would like to hide the files in.

    3. Select all of the files you want to hide, and create a ZIP or RAR file with them using a program like WinRAR, WinZip, 7Zip, etc.

    4. Now you should have your archive next to your files that you want to hide, even though they are in the archived file already, with the JPEG image you would like to hide all of this in.

    5. Go to “Start,” “Run,” and type: cmd.

    6. Now type: cd \, then type: cd Folder1. (Of course, replace Folder1 with the name of your folder.)

    7. Type the following: copy /b myimage.JPG + archivedthing.rar myimage.jpg

    (Note: Replace the name “myimage” with the name of your image, and replace “archivedthing” with the name of your compressed file.)

    8. You should receive a response similar to the following: “1 file(s) copied.”

    9. To find the files in your image, all you need to do is right-click on the image and select “Open With…” and select “WinRAR” or the name of the program you used to archive the original files.

    Windows Hide folders

    Hide files in Windows

Mac

Now, for Mac users it is different. The following method can be used for Unix-like systems, thus Macs.

Method 5

    1. Create a folder in your “Home” directory through your directory by typing the following: mkdir .myfoldername The folder has to have a dot before it. E.g. .myfoldername.

    2. Go to your home directory and click “Go” then “Go to Folder.” Type the following: ~/.myfoldername.

    3. You should now be able to put stuff in your hidden folder.

    (Note: Finder remembers your previously typed folders.)

What other methods do you use to hide a folder, a file or a drive?

(By) Will is a computer nerd and geek that runs his blog at Advanced Tech Solutions.

Found this article useful? Subscribe to MakeUseOf via email or RSS and receive free daily updates about new cool websites. Plus get free cheat sheets to your favorite programs.

Subscribe to MakeUseOf

Filed Under: How-To ¦ Lists of tools ¦ Mac ¦ Windows
Tags: , , , , ,

Latest from Will Mueller:

Blog Posts from Will Mueller:
Most Popular:
  • 100 Portable Apps for your USB Stick (both for Mac and Win)
  • 1 Awesome Gmail tip You Don’t Know about. Seriously.
  • 40 Unusual Websites you should Bookmark
  • The Best, Free Alternatives to Nero CD/DVD Burner
  • 5 Packs to Transform Windows to other OS
  • 13 Bargain Websites That are Cheaper than eBay
  • 5 Tools to Make Windows XP Look Like Vista
  • 7 Excellent destinations to watch TV Shows for FREE
  • 18 Free Ways To Download Any Video off the Internet
  • Watch Popular TV Shows,Cartoons,Movies,Anime for free
  • 14 Comments » Leave One...

    Comment by daredevil
    2008-06-28 12:04:19

    these methods are good…but i think its better to download programs to hide files

     
    Comment by mm
    2008-06-28 14:38:19

    method one doesn’t work correctly, I can still see the hidden folders in windows explorer…but in the cmd it doesn’t appear

    Comment by Jason
    2008-06-28 16:00:44

    Yeah, method one just marks it as a system file. All you have to do to see it is make Windows show “protected operating system files.”

    This is like hiding your pr0n mags by pasting them inside the cover of Better Homes and Gardens. Not Recommended.

     
     
    Comment by Ashwin CS
    2008-06-28 17:32:54

    Method 4 can also be used to upload and share Mp3 and Video files using image hosting/sharing sites like flickr or Picasa, just copy the mp3 or video file using the above method and upload.

    Comment by death
    2008-07-30 09:54:37

    u sly dog! good thinkin’

     
     
    Comment by James
    2008-06-28 17:44:22

    If I ever want to hide something, I put the file in a password protected rar file and remove the file extension. Throw in a random name and bury it in the system files and it is good for most things.

     
    Comment by Mackenzie
    2008-06-28 22:45:29

    The dot is not a Mac thing. That is an old, old UNIX convention. We Linux users do that too. We’re not dumb enough to think it’s actually securely hidden, though, because ls -a always tells otherwise.

     
    Comment by Nik
    2008-07-01 10:07:01

    Is there a free windows program that will password protect folders?

     
    Comment by death
    2008-07-30 09:53:15

    if you want 2 get a little more difficult you could use method for a different way.

    instead of going the easy route and making a new folder in drive c just figure out how 2 find a folder you all ready have

    type this into cmd to find say the Documents folder

    cd\
    cd users
    cd owner
    cd documents

    and u’ll get a command line that looks something like this
    C:\Users\Owner\Documents\>

    im pretty sure it’l work on other computers but this is just the way i went about figuring it out!
    happy testing and never stop learning

    in case ure wondering it took me all of maybe 2 minutes to figure this out! lol

     
    Comment by Comment... they never stop
    2008-09-11 10:41:57

    Thank u :D

    (used nr.2)

     
    Comment by Bro'
    2008-09-11 10:44:03

    You can also disguise wav’s and img’s by changing the (dot)something to any other format.

     
    Name (required)
    E-mail (required - never shown publicly)
    URI
    Subscribe to comments via email
    Your Comment (smaller size | larger size)
    You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment. All comments are moderated. If your comment does not show up immediately, be patient. It will show up momentarily.

    Responses:



    © 2007-2008 MakeUseOf.com. All rights reserved. Design by Unique Blog Designs.