Page 1 of 1

Windows AES syntax different path

Posted: Tue Jan 23, 2018 1:48 pm
by tomtom
Aescrypt always encrypts files in the same directory but I'd like to encrypt file
from c:\test.exe
to d:\test.exe.aes
Is it possible?

Re: Windows AES syntax different path

Posted: Wed Jan 24, 2018 7:16 am
by paulej
If using the command-line version, you can specify the output file name using the -o option. The GUI version will only output in the same directory. That's purposefully done to make the program as easy to use as possible.

Re: Windows AES syntax different path

Posted: Wed Jan 24, 2018 12:46 pm
by tomtom
Thanks for the quick response but there is a problem with the -o option
I will give an example:
aescrypt -e -p abc -o d:\*.aes c:\*.exe
Error opening output file d:\*.aes: Invalid argument
Do you have any idea how to solve it?

Re: Windows AES syntax different path

Posted: Wed Jan 24, 2018 2:36 pm
by paulej
You can't specify an output file using a wildcard. It needs to be a specific file name. For example, you can do this:

Code: Select all

aescrypt -d -o e:\foo.txt c:\foo.txt.aes
But the wildcard character "**" is not a valid output file name. Easiest way to do a bunch of files in a batch is to write a batch file to do that one at a time.

Re: Windows AES syntax different path

Posted: Wed Jan 24, 2018 6:35 pm
by tomtom
Where could I find examples of such batch files?

Re: Windows AES syntax different path

Posted: Wed Jan 24, 2018 11:45 pm
by paulej
This is an example I threw together quickly. There might be a better way to do it, but I'm not a batch file guru.

Code: Select all

@echo off

rem
rem batchcrypt <password> <outputdir> <filenames>
rem

for %%F in (%3 %4 %5 %6 %7 %8 %9) do c:\"Program Files"\AESCrypt\aescrypt -e -p %1 -o %2\%%F.aes %%F
You would call this from the command-line like this:

Code: Select all

batchcrypt mypassword e:\outputdir *.doc
That would encrypt all *.doc files in the current directory, putting all the encrypted versions in e:\outputdir.

Re: Windows AES syntax different path

Posted: Thu Jan 25, 2018 5:50 pm
by tomtom
Once again thank you very much for your quick reply and this great example, which is very useful to me. Is it possible to provide a password stored in a separate file?

Re: Windows AES syntax different path

Posted: Thu Jan 25, 2018 9:00 pm
by paulej
The Linux version can do that, but I've not ported it over to the Windows version. I intend to, but I've intended to for a year or more. So, don't expect it. :)

Seriously, I want to do that, but at the same time merge some of the code and clean things up in the process. And it's the latter that will require a bit of time to do right.