How to install CLI in Windows Path?

I’ve successfully installed Duplicacy 2.1.1 on Windows 10. I’m able to run the GUI with no problem but I’d like to use the CLI for most things.

I’ve found duplicacy_win_x64_2.1.1.exe in the …\AppData\Local\Duplicacy folder. I can execute it from the command line with no problem as long as I’m in that folder. However, what’s the best way to put it in the windows path so that I can run “duplicacy” from anywhere? Coping duplicacy_win_x64_2.1.1.exe to system32 and renaming it to duplicacy.exe can’t be the correct option, right?

How are others doing this?

Thanks kindly!

My scripts call at the beginning of each run a single central configuration script, and one of the commands in this configuration script is:

set PATH=%PATH%;D:\the_folder_where_you_want_the_executable

This will add to the environment variable PATH the folder where the executable is, and you will be able to run duplicacy.exe from any location.

In addition to setting PATH, as you mentioned, you have the issue of whether you want to type ** duplicacy_win_x64_2.1.1.exe or just duplicacy.exe (or just duplicacy) on the CLI.

You probably shouldn’t rename it, otherwise the GUI won’t work. So you could either have a friendly symlink to it or TBH just make a copy. Personally, I’d just make a copy, coz there might be the occasion when an updated .exe is released here to fix a small issue you might just want to test it separately.

1 Like

Good point, this is true.

But in my case, as I only use CLI, I have no problems with filenames. On the contrary, as I have several scripts calling “duplicacy.exe”, when a new version comes out I make a unique copy of the new version of the executable, replacing the previous “duplicacy.exe”, but keeping this simple name.

Awesome! Thanks for the input.

I do exactly what you suggested. I copy the duplicacy download, rename it duplicacy.exe and put it in the system32 folder. I don’t see what is bad about doing that. It is what I have done since 15-20 years for such cases. I can’t do scripting and for me that is simply the easiest and most convienent solution. Works great for me.

Cheers

Besides solutions that are offered by @towerbr and @Droolio you can use aliases in windows – see more details here alias - Aliases in Windows command prompt - Stack Overflow

But I still agree with @Droolio, the best would be to copy the executable to some folder that is already in the search path. (Or you can add your own C:\Tools folder into path: Win+Break, Advanced System Settings, Advanced, Environment Variables).

One of the advantages of duplicacy (and any other piece of software written in Go) is that it is a monolithic self-sufficient executable so there is no need to worry about dependencies and “DLL hell”