Issue with backup via rclone using Windows batch file

Hi, I’m trying to make backup to Dropbox via rclone, using Windows batch file.

restic -r rclone:dropbox:myRepo backup myDir

I can run this directly in command prompt without issue, however, when I write this command to a batch file (backup.bat for example) and run it in command prompt, the following error occurs:

Fatal: unable to open config file: <config/> does not exist
Is there a repository at the following location?

How can I fix this?

It is most likely not restic problem but your OS - and knowledge how to use it.

If restic works from CMD and not from script it clearly means that your script environment is not the same as CMD one…

To try to debug it I would start with for example:

rclone lsd dropbox:myRepo -vv

from the same script. Does it work? If not it should tell you what is missing. -vv flag for rclone produces debug output.

Run it from CMD and from within your script.

I rebooted Windows two times and the problem had been solved. (I don’t know why but I needed two reboots, not one)