Mounting multiple drives with a single batch script

What is the problem you are having with rclone?

Hello, I recently started using rclone and I need help with something.
I'm trying to make a batch script that, when opened once, mounts all my drives after I enter the password only once.

What is your rclone version (output from rclone version)


Which cloud storage system are you using? (eg Google Drive)

Google Drive, Box

hello and welcome to the forum,

when you posted there was a template of question, please answer them so we can help you.

I've provided the necessary information, as for my problem and what command I was trying to run, I'm trying to make a batch script that, when opened once, mounts all my drives after I enter the password only once. But as you can tell because of the fact that I opened this thread, I can not figure out how to do it. As for my config it's encrypted so I did not bother sending it. Also as for my rclone log with the -vv tag. I also don't see how that's useful considering I've literally mentioned my version.
But sure, here you go.

2021/09/09 20:37:57 DEBUG : rclone: Version "v1.56.0" starting with parameters ["rclone" "-vv"]
  rclone [flags]
  rclone [command]

Available Commands:
  about           Get quota information from the remote.
  authorize       Remote authorization.
  backend         Run a backend specific command.
  cat             Concatenates any files and sends them to stdout.
  check           Checks the files in the source and destination match.
  checksum        Checks the files in the source against a SUM file.
  cleanup         Clean up the remote if possible.
  config          Enter an interactive configuration session.
  copy            Copy files from source to dest, skipping already copied.
  copyto          Copy files from source to dest, skipping already copied.
  copyurl         Copy url content to dest.
  cryptcheck      Cryptcheck checks the integrity of a crypted remote.
  cryptdecode     Cryptdecode returns unencrypted file names.
  dedupe          Interactively find duplicate filenames and delete/rename them.
  delete          Remove the files in path.
  deletefile      Remove a single file from remote.
  genautocomplete Output completion script for a given shell.
  gendocs         Output markdown docs for rclone to the directory supplied.
  hashsum         Produces a hashsum file for all the objects in the path.
  help            Show help for rclone commands, flags and backends.
  link            Generate public link to file/folder.
  listremotes     List all the remotes in the config file.
  ls              List the objects in the path with size and path.
  lsd             List all directories/containers/buckets in the path.
  lsf             List directories and objects in remote:path formatted for parsing.
  lsjson          List directories and objects in the path in JSON format.
  lsl             List the objects in path with modification time, size and path.
  md5sum          Produces an md5sum file for all the objects in the path.
  mkdir           Make the path if it doesn't already exist.
  mount           Mount the remote as file system on a mountpoint.
  move            Move files from source to dest.
  moveto          Move file or directory from source to dest.
  ncdu            Explore a remote with a text based user interface.
  obscure         Obscure password for use in the rclone config file.
  purge           Remove the path and all of its contents.
  rc              Run a command against a running rclone.
  rcat            Copies standard input to file on remote.
  rcd             Run rclone listening to remote control commands only.
  rmdir           Remove the empty directory at path.
  rmdirs          Remove empty directories under the path.
  selfupdate      Update the rclone binary.
  serve           Serve a remote over a protocol.
  settier         Changes storage class/tier of objects in remote.
  sha1sum         Produces an sha1sum file for all the objects in the path.
  size            Prints the total size and number of objects in remote:path.
  sync            Make source and dest identical, modifying destination only.
  test            Run a test command
  touch           Create new file or change file modification time.
  tree            List the contents of the remote in a tree like fashion.
  version         Show the version number.

Use "rclone [command] --help" for more information about a command.
Use "rclone help flags" for to see the global flags.
Use "rclone help backends" for a list of supported services.
1 Like

please understand that we cannot see into your computer and we volunteer our time.

Yes asdffdsa I do understand that and I do not like wasting anyone's time. But please also understand that I've provided you all the information that I was asked of.

please post:

  • the output of rclone version
  • the rclone mount command.
  • the top 20 lines of the debug log of that rclone mount command.
rclone v1.56.0
- os/version: Microsoft Windows 10 Pro 2009 (64 bit)
- os/kernel: 10.0.19043.1202 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.16.5
- go/linking: dynamic
- go/tags: cmount

Output of rclone version

The rclone mount command that I'm using
rclone.exe mount --vfs-cache-mode writes --cache-dir "D:\RClone Cache" "Box 1": x:

This is the command I'm using to mount a single drive, I have no way of mounting multiple drives in one go, I've tried all methods, all of them require me to enter my password multiple times, which is why I created this thread to ask for help. I'm having no problem mounting the drive, the problem I'm having is that I want to mount multiple drives in one go without having to enter the config password multiple times, I can make my script try and mount multiple drives in one go by making multiple mount scripts and calling those cmd files but it just opens multiple rclone windows and asks me to enter password. Asking it to not open them as a new process breaks the script.

Debug log of the rclone mount command

C:\Users\Truck\Desktop\GG\rclone-v1.56.0-windows-amd64>rclone.exe mount --vfs-cache-mode writes --cache-dir "D:\RClone Cache" "Box 1": x:
Enter configuration password:
The service rclone has been started.

This is what happens when I ask it to not open it as a new process. It completely breaks the script and makes it impossible to enter the password.

This is what is inside the batch file in this image
start /b photos1.bat
start /b photos2.bat

And then both the batch files having the same mount command (with different drive names ofc)

ok, using windows....

this should that should do all you asked for.

set RCLONE_CONFIG_PASS=thesecretpassword

start rclone.exe mount --vfs-cache-mode writes --cache-dir "D:\RClone Cache\Box1" "Box 1": x:
start rclone.exe mount --vfs-cache-mode writes --cache-dir "D:\RClone Cache\Box2" "Box 2": y:
start rclone.exe mount --vfs-cache-mode writes --cache-dir "D:\RClone Cache\Box3" "Box 3": z:

to hide the open windows use --no-console

Alright, that works. Thank you.

Is there a way for it to ask for the password, but only once. So that I don't have to store my password in a .bat file. It just seems kinda insecure is all.

With some scripting, or an external helper tool, you will be able to achieve that with the --password-command flag. There are some guides in the wiki on this.

using old style dos batch scripts, no real way to secure the password.
if anyone can read the script, they can figure out how to get the password.

one possible, kinda, sorta workaround is to run rclone as system user, keep the config file in the system user profile.
and adjust the file permissions for the script and for rclone.conf