How do I encrypt a win8.1/win10 folder?

Source: Internet
Author: User
Tags goto

How do I encrypt a win8.1/win10 folder?


Small series on the name of their own folder to do the demonstration

First, create a new text document

Enter the following exactly when opened


@ECHO off

Title Folder Private


If not EXIST Private goto Mdlock


Echo, are you sure you want to encrypt the hidden private 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 "HTG Lock"

attrib +h +s "HTG Lock"

Echo Folder Locked

Goto END


Echo enters a password to unlock the folder

set/p "Pass=>"

If not%pass%== this setting password goto FAIL

Attrib-h-S "HTG Lock"

ren "HTG Lock" Private

Echo Folder Unlocked successfully

Goto END


echo Invalid Password

Goto END

: Mdlock

MD Private

Echo Private created successfully

Goto END

: End

"Set password Here" can be replaced by the password you want to set, pay attention to do not delete the space, when finished remember to save

Let's rename the file you just edited and rename it to Lock.bat.

Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.