Keeping a folder secret or out of reach of others in your computer (running on Windows operating system only) usually becomes more difficult if a common computer is used by all family members. But after reading this article, You'll not only be able to create a secret hidden folder but also It'll be a password protected folder, until unless user don't enter exact password. Your folder won't open. So, let's see how to do this. Follow the steps below.

Steps

  1. 1
    Open Notepad. If you aren't sure where it's located on your computer, press Win+R. Type notepad and press Enter.
  2. 2
    Copy and paste the code given below carefully:
      Quote:
      Quote: cls
      @ECHO OFF
      title Folder Private
      if EXIST "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}" goto UNLOCK
      if NOT EXIST Private goto MDLOCKER
      :CONFIRM
      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.
      goto CONFIRM
      :LOCK
      ren Private "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
      attrib +h +s "Control Panel.{21EC2020-3AEA-1069-A2DD-08002B30309D}"
      echo Folder locked
      goto End
      :UNLOCK
      echo Enter password to unlock folder
      set/p "pass=>"
      if NOT %pass%== password 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
      :FAIL
      echo Invalid password
      goto end
      :MDLOCKER
      md Private
      echo Private created successfully
      goto End
      :End
      
    Advertisement
  3. 3
    Save the file with any name followed by extension .bat. (For example: XXX.bat)
  4. 4
    Double-click the XXX.bat file icon. It'll create a folder for you under the name 'Private'.
  5. 5
    Open the folder, place whatever files/folders you want to keep out of reach of others and close the folder.
  6. 6
    Double-click 'XXX.bat' file icon.
  7. 7
    Type Y and press Enter key. It'll hide your the folder immediately.
    • Now, nobody will be able to see that folder anywhere in your computer.
  8. 8
  9. Advertisement

Community Q&A

  • Question
    How do I set a password for my folder?
    Community Answer
    Community Answer
    In the part : set/p "pass=>" if NOT %pass%== password goto FAIL, change the word 'password' to whatever you want.
  • Question
    If a text locker file is deleted by mistake, how can I recover the data that I locked in the private folder?
    Community Answer
    Community Answer
    Go to the folder the hidden file was in, press view (at the top) and check hidden items.
  • Question
    If the name does not change on a newly created folder when I change line 4, is there somewhere else I am supposed to change the name as well?
    Community Answer
    Community Answer
    I think line 4 is just to give the batch file a title. To change the folder name from "Private" to something else, you need to replace the word "Private" in lines 6, 17, 26, and 33.
Advertisement

Warnings

  • You may need administrative privileges in order to open command prompt. Better login to your computer system as an administrator.
    ⧼thumbs_response⧽
  • Your folder exists all because of 'XXX.bat' file. Keep it safe in your computer and never ever delete it. Otherwise, you won't be able to open the folder again and may loose data you placed inside the folder.
    ⧼thumbs_response⧽
Advertisement

About This Article

wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, volunteer authors worked to edit and improve it over time. This article has been viewed 89,443 times.
How helpful is this?
Co-authors: 2
Updated: August 14, 2019
Views: 89,443
Categories: Command Prompt
Advertisement