Avatar of Durga Ojha
Durga Ojha
Flag for India asked on

How to encrypt a batch file

How to encrypt a batch file which is having some commands to execute
so that others cannot check the command inside
Windows BatchWindows 7

Avatar of undefined
Last Comment
Bill Prew

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Michael Pfister

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Durga Ojha

ASKER
Wow . Perfect Boss (Y)
Durga Ojha

ASKER
Perfect .. Thanks a lot
Also I wanted like any application can encrypt the contents of the batch file.
so that if any one open the batch file could not see in... and only can execute it
and also there should be one decrypt option...
Bill Prew

Just so you are aware, for people who are clever, this doesn't really solve the problem.  While the BAT file will be encrypted and stored in an EXE, when that EXE is actually run the BAT file is decrypted and saved in a readable format in a temporary file on the system,  That temporary file is then executed as a normal BAT script, and afterwards deleted.  So while the script is running the file is visible, and afterwards it may be available to recover and view via trash and undelete.  So don't trust this for anything too secure, like a BAT file that has password or other sensitive info in it...


»bp
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23