Bat file encryption bat decryption script (making bat garbled)

Source: Internet
Author: User

Bat encryption script(Save As A. BAT file)

@ Echo off
Cls
Color 2a
: Start
Cls
Echo *************************************** ****************************************
Echo **
Echo * BAT password final version *
Echo **
Echo *************************************** ****************************************
Echo.
Echo.
The final version of echo BAT encryption is an updated version of "BAT encryption tool", which has many advantages over the previous version of encryption tool:
Echo.
Echo★You can encrypt any batch files at a time to save trouble.
Echo.
Echo★You can enter any batch processing that requires encryption, making encryption more flexible.
Echo.
Echo★It can automatically identify incorrect input, making it more user-friendly.
Echo.
Echo Description: Enter the batch processing file to be encrypted below, and directly enter the batch processing file name as the BAT under the encrypted current directory. You can also specify any BAT with the path. encrypt generated in the current directory. the bat file is encrypted for batch processing.
Echo.
Echo Author: mulinsen QQ: 573381312 BYE
Echo.
Echo.
Echo.
Set/p file = enter the batch to be encrypted and press enter (q = quit ):
If "% file %" = "q" goto quit
Echo % file % | findstr/I "\. bat $"> nul & goto go
Echo % file % | findstr/I "\. cmd $"> nul & goto go
Cls
Echo ====================
Input echo correctly!
Echo ====================
Echo.
Echo.
Echo press any key to re-enter ......
Pause> nul
Goto start
: Go
If not exist "% file %" goto newly
If exist encrypt. bat copy encrypt. bat encryptbak. bat
Echo % a % a % a % a % a % a % a % a % a % a % a % a % a % a % a % a % a % a> "% tmp % \ encrypt. tmp"
Echo cls> "% tmp % \ encrypt. tmp"
Type "% file %"> "% tmp % \ encrypt. tmp"
Setlocal enabledelayedexpansion
For % I in ("% tmp % \ encrypt. tmp") do (
Echo % ~ Zi> nul 2> nul
Set size = % ~ Zi
Set num =! Size :~ -1!
Set/a mod =! Num! % 2
If! Mod! Equ 0 (goto even) else (goto odd)
)
: Even
Copy "% tmp % \ encrypt. tmp" encrypt. bat
Del "% tmp % \ encrypt. tmp"
Cls
Echo ======================================
Echo congratulations! Batch encryption successful ^!
Echo ======================================
Echo.
Echo.
Echo press any key to exit ......
Pause> nul
Goto quit
: Odd
Echo.> "% tmp % \ encrypt. tmp"
Copy "% tmp % \ encrypt. tmp" encrypt. bat
Del "% tmp % \ encrypt. tmp"
Cls
Echo ======================================
Echo congratulations! Batch encryption successful ^!
Echo ======================================
Echo.
Echo.
Echo press any key to exit ......
Pause> nul
Goto quit
: Newly
Cls
Echo ======================================
Echo cannot find the batch file. Please enter it again!
Echo ======================================
Echo.
Echo.
Echo press any key to start ......
Pause> nul
Goto start
: Quit
Exit

BAT decryption(Save As A. BAT file)

@ Echo off
Mode con: cols = 80 lines = 25
: Index
Color 27
Cls
Echo ╭ ── ─
Echo │
Echo ── ─
Echo │
Echo │ ── ─ ╯ │
Echo │
Echo │
Echo │ this tool is used to decrypt the encrypted batch processing of the obfuscated text encoding type! │
Echo │
Echo │ enter the batch to be decrypted below and press Enter. │
Echo │
Echo │ we recommend that you drag the batch files to be decrypted to this window for release. │
Echo │
Echo │ after decryption is successful, the new _ unencrypted file name will be generated under the program directory. File suffix name "│
Echo │ format file. │
Echo │
Echo │ Note: If the directory contains a file named "new _ name to be decrypted. File suffix", │
Echo │ will be replaced. │
Echo │
Echo │
Echo ╰ ── ─
Echo.
Set route = % cd %
Set ravel =
Set/p ravel = enter the batch to decrypt:
Set "ravel = % ravel:" = %"
If/I "% ravel :~ -4% "=". bat "if exist" % ravel % "goto go
If/I "% ravel :~ -4% "=". cmd "if exist" % ravel % "goto go
Cls
Echo ╭ ── ─ accept
Echo ── ─ ┤ 文 ├ ──
Echo │ ── ╯
Echo │
Echo │ the specified file does not exist or the file is not a batch processing type! │
Echo │
Echo │ press any key to re-enter... │
Echo │
Echo ╰ ── ─
Echo.
Echo.
Echo press any key to re-enter...
Pause> nul
Goto index

: Go
For/f "tokens = *" % c in ("% ravel %") do (
Cd/d "% ~ Dpc"
If exist "% route % \ new _ % ~ Nxc "attrib-s-h-r-a" % route % \ new _ % ~ Nxc"
Echo author: pengfei@www.cn-dos.net> "% route % \ new _ % ~ Nxc"
For/f "tokens = *" % I in (% ~ Nxc) do (
Echo % I> "% route % \ new _ % ~ Nxc"
)
)
Cls
Echo ╭ ── ─ accept
Echo ╭ ── ─
Echo │ ── ╯
Echo │
Echo │ congratulations! Batch decryption successful! │
Echo │
Echo ╰ ── ─
Echo.
Echo.
Echo press any key to exit...
Pause> nul
Exit

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: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.