Windows AES syntax different path

Discussion related to AES Crypt, the file encryption software for Windows, Linux, Mac, and Java.
Post Reply
tomtom
Posts: 4
Joined: Tue Jan 23, 2018 1:42 pm

Windows AES syntax different path

Post by tomtom » Tue Jan 23, 2018 1:48 pm

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?

User avatar
paulej
Posts: 516
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Windows AES syntax different path

Post by paulej » Wed Jan 24, 2018 7:16 am

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.

tomtom
Posts: 4
Joined: Tue Jan 23, 2018 1:42 pm

Re: Windows AES syntax different path

Post by tomtom » Wed Jan 24, 2018 12:46 pm

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?

User avatar
paulej
Posts: 516
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Windows AES syntax different path

Post by paulej » Wed Jan 24, 2018 2:36 pm

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.

tomtom
Posts: 4
Joined: Tue Jan 23, 2018 1:42 pm

Re: Windows AES syntax different path

Post by tomtom » Wed Jan 24, 2018 6:35 pm

Where could I find examples of such batch files?

User avatar
paulej
Posts: 516
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Windows AES syntax different path

Post by paulej » Wed Jan 24, 2018 11:45 pm

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.

tomtom
Posts: 4
Joined: Tue Jan 23, 2018 1:42 pm

Re: Windows AES syntax different path

Post by tomtom » Thu Jan 25, 2018 5:50 pm

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?

User avatar
paulej
Posts: 516
Joined: Sun Aug 23, 2009 7:32 pm
Location: Research Triangle Park, NC, USA
Contact:

Re: Windows AES syntax different path

Post by paulej » Thu Jan 25, 2018 9:00 pm

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.

Post Reply

Return to “AES Crypt”