BAT file encryption Bat decryption script (let bat garbled) _dos/bat

Source: Internet
Author: User
Tags decrypt goto
Bat Encryption Script(Save As. BAT file)

@echo off
Cls
Color 2a
: Start
Cls
Echo *******************************************************************************
Echo * *
echo * BAT Encryption final version *
Echo * *
Echo *******************************************************************************
Echo.
Echo.
Echo Bat encryption The final version of the "Bat encryption Tool" updated version, compared to the previous version of the encryption tool has many advantages:
Echo.
Echo★ can successfully encrypt any batch file at a one-time, more convenient.
Echo.
Echo★ allows you to enter any batch that requires encryption, with greater encryption flexibility.
Echo.
Echo★ can automatically judge error input, more humane.
Echo.
Echo Description: Enter the batch file you want to encrypt below, directly enter the batch file name to encrypt the bat in the current directory, or you can specify any bat with the path. The Encrypt.bat file generated under the current directory is an encrypted batch.
Echo.
echo Author: Mulinsen qq:573381312 BYE
Echo.
Echo.
Echo.
set/p file= Please enter the batch to be encrypted and press ENTER (Q= exit):
If "%file%" = = "Q" goto quit
echo%file%|findstr/i "\.bat$" >nul && Goto Go
echo%file%|findstr/i "\.cmd$" >nul && Goto Go
Cls
Echo ==============
echo Please input 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 %%%%a %%% %a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a % %%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%% %a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%a %%%%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 presses 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 presses any key to exit ...
Pause>nul
Goto quit
: Newly
Cls
Echo ================================
echo cannot find the batch file, please re-enter!
Echo ================================
Echo.
Echo.
echo presses any key to start ...
Pause>nul
Goto Start
: Quit
Exit

Bat Decryption(Save As. BAT file)

@echo off
Mode con:cols=80 lines=25
: Index
Color 27
Cls
Echo╭──────────────╮
Echo││
Echo╭─────────┤bat Decryption Tool ├─────────╮
Echo││││
Echo│╰──────────────╯│
Echo││
Echo││
Echo│ This tool is used to decrypt encrypted batches of garbled text encoding types! │
Echo││
Echo│ fill in the following batch to be decrypted and press ENTER. │
Echo││
Echo│ recommends that the batch file to be decrypted be dragged directly to this window for release. │
Echo││
Echo│ decryption succeeds in this program directory to generate "New_ to decrypt file name." File suffix name "│
Files in echo│ format. │
Echo││
Echo│ Note: If there is a file in this directory that says "New_ to decrypt filename. file suffix name", │
Echo│ will be replaced. │
Echo││
Echo││
Echo╰────────────────────────────────╯
Echo.
Set route=%cd%
Set ravel=
set/p ravel= Please 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╭──────────╮
Echo╭─────────┤ File Error ├────────╮
Echo│╰──────────╯│
Echo││
echo│ Specifies that the file does not exist or that the file is not a batch 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╭──────────╮
Echo╭─────────┤ decryption Successful ├────────╮
Echo│╰──────────╯│
Echo││
Echo│ Congratulations, batch processing decryption success! │
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.