System hacks: do not install software batch process for folder lock

Everyone has some little secrets on their computer that they don’t want people to know, and the conventional way to protect them is to use third-party encryption software. However, encryption software can take up system resources, and the memory of passwords can be a headache. For Windows 10 users, you can protect your secret files with the help of the batch protection file that comes with the system.

First, start Notepad and enter the following code, then save it as lock.bat and place it on the desktop (Figure 1).

cls

@ECHO OFF

title Folder Private

if EXIST “Network. {208D2C60-3AEA-1069-A2D7-08002B30309D}” goto UNLOCK

if NOT EXIST Private goto MDLOCKER

:CONFIRM

echo Is the encrypted folder to be locked? (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 “Network. {208D2C60-3AEA-1069-A2D7-08002B30309D}”

attrib +h +s “Network. {208d2c60-3aea-1069-a2d7-08002b30309d}”

echo Folder is locked

goto End

:UNLOCK

echo Please enter the password to unlock the folder

set/p “pass=>”

if NOT %pass%== cfan goto FAIL

attrib -h -s “network. {208D2C60-3AEA-1069-A2D7-08002B30309D}”

ren “network. {208d2c60-3aea-1069-a2d7-08002b30309d}” private

explorer Private

echo The folder has been successfully unlocked

goto End

:FAIL

echo Wrong password

goto end

:MDLOCKER

md Private

echo The encrypted folder has been created

goto End

:End

201809wjjs1

Code Explanation.

The above batch encryption file is achieved by creating class identifiers and setting system, hidden attributes for them. First, create a directory named “Private” in the current directory, set the password (created with the if NOT %pass%== cfan statement, the default is “cfan”), and then rename it with the rem command “network. {208D2C60-3AEA-1069-A2D7-08002B30309D}” (class identifier, you can expand the [HKEY_LOCAL_MACHINESoftwareClassesCLSID] located in the registry and choose any identifier you need). After entering the password again, the code will use the rem command to restore the “Network. {208D2C60-3AEA-1069-A2D7-08002B30309D}” as “Private” and unhide its system and hidden attributes for easy access.

So when we need to hide the files, just copy the above batch process to the directory where we need to hide the files. Run the above batch process as administrator and it will automatically create the “Private” folder in the current directory (Figure 2).

201809wjjs2

Figure 2 Creating an encrypted directory

Follow the prompts to move all the files to the above encrypted directory, and continue to run the above batch process after you finish moving the files, and when prompted whether to encrypt the directory, enter “Y” to confirm (Figure 3).

201809wjjs3

Figure 3 Confirming the encrypted folder

When you are prompted to enter Y to confirm, the batch process will automatically rename the “Private” folder to “Network” (the folder will automatically become the system folder Network), and the system and hidden properties will be added automatically (Figure 4).

201809wjjs4

Figure 4 The encrypted folder is renamed to “Network”.

Because the folder created above becomes a system folder and is automatically added with system, hidden attributes. So by default users cannot see this directory (you need to set the folder view mode to “Show hidden files, folders and drives” and remove the “Hide protected OS files” checkbox). This will allow the user to see the encrypted folder (Figure 5).

201809wjjs5

Figure 5 View mode setting

Of course, because the encrypted files are renamed as system folder (network), even if the user can view the above encrypted directory, the user cannot see the files in it after double-clicking to open it, and the system network directory is opened (Figure 6).

201809wjjs6

Figure 6 User cannot see the encrypted files when opening

If you need to access the encrypted directory yourself, run the batch process again as above and enter the access password “cfan” in the window that opens when prompted (Figure 7).

201809wjjs7

Figure 7 Enter the access password

After entering the correct password, the system will prompt that the folder is unlocked. At the same time, the batch process will automatically rename the network system folder to “Private” in the background, and call “explorer Private” to open the encrypted folder automatically, and access the encrypted folder in the open window (Figure 8). (Figure 8).

201809wjjs8

Figure 8 Accessing the encrypted directory

If you need to encrypt the folder again, run the batch process again after accessing the directory as above to re-encrypt and hide it. Of course, since the encryption is done in the form of a class identifier, if we forget the password and need to access the encrypted directory, we can decrypt it ourselves by starting a command prompt and entering the following command (Figure 9).

rem Unhide the attribute

attrib -h -s “network. {208D2C60-3AEA-1069-A2D7-08002B30309D}”

rem Rename to Private folder

ren “network. {208d2c60-3aea-1069-a2d7-08002b30309d}” Private

201809wjjs9

Figure 9 Manually decrypting a folder

Leave a Comment