China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-12 20:10
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Batch Processing to Realize Folder Encryption (Original) View 1,928 Replies 6
Original Poster Posted 2009-07-05 08:40 ·  中国 湖南 常德 桃源县 电信
初级用户
Credits 62
Posts 33
Joined 2007-06-16 07:33
19-year member
UID 91475
Gender Male
Status Offline
Can realize the encryption function of similar software on the market. As for things like King Kong encryption, I won't mention it——It takes too much time to encrypt file contents with the MD5 encryption algorithm, which is not as good as using WinRAR encryption.

The code for file encryption.bat is as follows:

@echo off
md RECYCLER55
:: Can create any directory similar to RECYCLER55 (of course, you can also take other names, but you have to modify RECYCLER55 accordingly later)
echo [.ShellClassInfo] > RECYCLER55\desktop.ini
echo CLSID={645FF040-5081-101B-9F08-00AA002F954E} >> RECYCLER55\desktop.ini
attrib RECYCLER55 +s +h
md \\.\%CD%RECYCLER55\MICROSOFT-7701091-6666888-16826688...\
:: Can create any deformed directory similar to MICROSOFT-1234567-1234567-12345678...\
cls
:: The above code creates a special directory

echo Please drag the folder to be encrypted and press Enter
echo (It is best that the folder is in the root directory and the folder name has no spaces):
set /p scrfile=
cls
md %scrfile%_bak
move %scrfile% %scrfile%_bak
for %%i in ("%scrfile%") do ren \\.\%CD%%%~ni_bak\%%~ni com9.{21EC2020-3AEA-1069-A2DD-08002B30309D}
:: The above code creates a directory 'the name of the directory to be encrypted_bak', then cuts the directory to be encrypted into it and renames it to the special directory name

:: echo The following is to cut the folder %scrfile%_bak into the opened folder
move %scrfile%_bak "%CD%RECYCLER55\MICROSOFT-7701091-6666888-16826688....\"
:: Note: When moving under XP above, MICROSOFT-7701091-6666888-16826688....\ has 4 dots. If there is one less dot, it will prompt that the path is not found
move %scrfile%_bak "%CD%RECYCLER55\MICROSOFT-7701091-6666888-16826688...\"
:: Note: When moving under Vista above, MICROSOFT-7701091-6666888-16826688....\ has only 3 dots. If there is one more dot, it will prompt that the path is not found
echo Encryption completed!

Next time I will post the decryption folder.bat
Floor 2 Posted 2009-07-05 10:44 ·  中国 广东 韶关 电信
高级用户
★★★
CMD感染者
Credits 691
Posts 383
Joined 2008-05-23 00:38
18-year member
UID 119451
Gender Male
Status Offline
%cd%\
Floor 3 Posted 2009-07-06 07:03 ·  中国 北京 联通
高级用户
★★★
据说是李先生
Credits 609
Posts 400
Joined 2008-04-23 15:55
18-year member
UID 116706
Gender Male
Status Offline
Floor 4 Posted 2009-08-17 07:57 ·  中国 福建 厦门 电信
新手上路
Credits 1
Posts 1
Joined 2009-07-10 04:43
17-year member
UID 149106
Gender Male
Status Offline
Sweat Modify the file path...............
Floor 5 Posted 2009-10-10 21:40 ·  中国 陕西 汉中 电信
初级用户
★★
Credits 128
Posts 122
Joined 2009-09-21 06:24
16-year member
UID 152378
Gender Male
Status Offline
Is it more secure to use "%cd%"...
Floor 6 Posted 2009-10-20 09:21 ·  IANA 局域网IP(Private-Use)
新手上路
Credits 10
Posts 9
Joined 2006-03-21 22:40
20-year member
UID 52551
Gender Male
Status Offline
The code makes my eyes dizzy.
Floor 7 Posted 2009-11-16 23:04 ·  中国 湖北 天门 电信
中级用户
★★
Credits 208
Posts 135
Joined 2009-09-12 12:00
16-year member
UID 151902
From 离恨天
Status Offline
L楼主,你这是老生常谈了。
Forum Jump: