In Windows password is stored in Credential Manager - if your automated way asks for password it means that kopia does not have rights to access it the way how you run it.
This is windows wizardry you find the way to solve or if not, use simplest possible method in your automated script: