Include syntax in the .bat script to read the password and run rclone

BY DELETING THIS COMMENT, I AM CONFIRMING I HAVE READ THIS AND WILL USE THE TEMPLATE BELOW FOR MY POST.

What is the problem you are having with rclone?

I put a password in the configuration, however every time I run the script.bat I need to put the password. I want to either put the password directly into the command or configure the script to read the password.

What is your rclone version (output from rclone version)

1.55.1

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

google drive

The command you were trying to run (eg rclone copy /tmp remote:tmp)

Paste command here
```c:\rclone\rclone -vP sync --progress C:\pasta gdrive:documentos\office


#### The rclone config contents with secrets removed.  
<!--  You should use 3 backticks to begin and end your paste to make it readable.   -->

Paste config here


RCLONE_ENCRYPT_V0:
fbbNvbCnrFxaE2v2jy2DzHx+oDT3ew/TmYtlAwKnmQLD0Pa0RmTFjRkwF5AI4E79GkTbrPiFzBrfJ1DINbIveXBBWy0HtT8Ae4Ylkzo4VvCiVA6bCjeZWXElSESwZnAuvOuIzsAuAlfq3eues5OzsMJZsxU6co+DZSyJpt/TahH24xq/4T2IPCuicdQ9t41+kI5aJyNscq/MvKBA1SAWK+3Kq9seqOV53ibi5W8EliHthv/uRJ1s9pcYgpFiRg/vWF6GdnXyQ/4QuM5LTFX+TIzZ4gNryVaiUKD4AtnJSGsCrULIqvwVcHGnUGo3IJ0ZBBb+cP64HUzKoxqiuG+DPBn15FSxKQKmfA8DxEA9EtdPAaCxLnrWhDfJ9rEP5igb6NDI4E3H6koZtliFV3FfThsGqFIikEf3Bk3DU8L4lS/QGw5wKmhgs5MmnMH31s1uujuWZpnF6af876OLzF5i+2/l0IKzBx7IxqZekE0vgbnfqN98E6Bo3NOy3ReFLHil4ZTuHxGcLgS8Yg3OkO8G09hFjfJP+/yvHYYk+FUUS+ThC7Fyca+Y0Xj13E4LT5T1LxP9Iaye7xWkEvTGtQmNiF+Np/BWqQ7keo/Z2LdP2vo1



#### A log from the command with the `-vv` flag  
<!-- You should use 3 backticks to begin and end your paste to make it readable.  Or use a service such as https://pastebin.com or https://gist.github.com/   -->

Paste log here

hi,

in each case, replace password with the rclone config encryption password
1.

set RCLONE_CONFIG_PASS=password
c:\rclone\rclone -vP sync --progress C:\pasta gdrive:documentos\office
echo password | c:\rclone\rclone -vP sync --progress C:\pasta gdrive:documentos\office

and the latest rclone is v1.57.0

set RCLONE_CONFIG_PASS=testedesenha

C:\rclone>echo password | c:\rclone\rclone -vP sync --progress C:\pasta gdrive:documentos\office
2021/12/17 16:46:28 ERROR : Failed to save config after 10 tries: Failed to move previous config to backup location: rename C:\Users\servidor.config\rclone\rclone.conf C:\Users\servidor.config\rclone\rclone.conf.old: O arquivo já está sendo usado por outro processo.

set RCLONE_CONFIG_PASS=password 

rclone listremotes
remote:
echo password | rclone listremotes
remote:

I need that too.
I need to encrypt rclone.conf so no one can use my configuration and I need to run the command inside an executable script.
I do the script without problems, but I don't know how to handle the rclone commands inside the script so that it doesn't ask for the password

sorry, not sure what you need help with?
let's do this one step at a time.

  1. you need to encrypt the rclone.conf file, correct?

yea.
I already put password in rclone.conf
so that every time I run the command to sync to the cloud, it asks for the password.
so far so good

you seem to be posting twice, in this topic and also here
this is confusing, so plesae do not post twice, just post here

ok, sorry my friend.
I really need this

friend, no problem.

so you already encrypted the rclone.conf file, correct?

yes, i already encrypted

i shared two scripts to work around that, what was wrong with both of them?

sorry, i didn't see these scripts. can post here again?

assuming that testedesenha is the password you used to encrypt the rclone.conf

set RCLONE_CONFIG_PASS=testedesenha

rclone listremotes
remote:

echo testedesenha | rclone listremotes
remote:

Perfect,
but how would i assemble this script?

Name archive: backup.bat
set RCLONE_CONFIG_PASS=testedesenha
rclone listremotes
c:\rclone\rclone -vP sync --progress C:\pasta gdrive:DOCUMENTOS\OFFICE

for backup.bat. let's start with something simple

set RCLONE_CONFIG_PASS=testedesenha
c:\rclone\rclone listremotes -vv

echo off
cls
set RCLONE_CONFIG_PASS=testedesenha
c:\rclone\rclone listremotes -vv
c:\rclone\rclone -vP sync --progress C:\pasta gdrive:DOCUMENTOS\OFFICE

it seems to me that this is the best way, but,
the password is recorded in windows. just give the set command and it is there for anyone

in another topic, i think you mentioned that the computer is a shared with others users, correct?
if true, really, there is no good solution to your problem.

not necessarily. I need to prevent any user from messing with the script and altering it and causing harm.

perhaps search the internet for convert .bat to .exe

for example,
https://www.howtogeek.com/50364/convert-a-batch-bat-script-to-an-executable-exe-file/
https://www.thewindowsclub.com/convert-bat-to-exe-file-windows