I have made a batch file which contains personal data, so to hide it from other people and to post it, I decided to "encrypt" it converting it to exe
via IExpress.
My batch file is named prime.bat
and it is located in %userprofile%
.
Here are the steps I ran with iexpress.exe
:
iexpress.exe
.Create new Self Extraction Directive file
Extract files and run an installation command
.Prime finder
).No prompt.
.Do not display a license.
.prime.bat
located in %userprofile%
(C:\Users\%username%
).cmd /c prime.bat
in Install Program
and left Post Install Command
as is (<None>
).Default (recommended)
.No message
.C:\Users\username\prime.exe
and did not check any of boxes below.No restart
.SED
file.Package created successfully!
As the batch file works with arguments, it must be run from the cmd. When I clicked the file single from explorer it opened correctly. Because I had put an error message if there are no arguments, it threw expected error and exited with 1
. If I type just prime.exe
in cmd, the above happens, and same output is produced.
But, if I run file from cmd again, but specify arguments, I get an error message in a new window. As I don't use English language and do not have the permissions to change language, I will try to translate the output:
Syntax error appeared in command line's selections.
Type
/?
after the command for help.
So, I typed prime.exe /?
, and a new window with help appeared. I think I am missing something in iexpress.exe
options.
I solved my problem using:
prime.exe /c:"cmd /c prime.bat numeric_arguments"
Which should be used when you want to send arguments to an IExpress 'compiled' file as /c
option specifies a new install command.