There are no special character combos. The character sequence is "...%6b...". Could it be that this is somehow interpreted as an escape code?
If you are having trouble with escaping on the command line you can try writing the password to a file then using
rclone obscure - <file-with-password.txt
With great help from @ncw we got a bit further. I was able to confirm my suspicion that this is an escape issue. The 64 character password I am using contains the sequence "%6b" and these characters are not processed correctly within the batch file. In contrast, if I generate the obscured password on the command line, the obscured password is valid. So we need to figure out why the batch file produces a different obscured password.
It looks like in the batch file, the "%" needs to be escaped by doubling it to "%%". Then the obscured password works. This is puzzling because the I thought providing the password in double quotes ("password") would prevent the need to escape. Is there a solution?
the quickest way to determine what chracters and combinations is/are the problem then change 1&1
to whatever text you want and run that command,
if it is a problem with certain characters, that command will complain with an error.
@asdffdsa: As noted above, the problem character has been identified as the percent sign. In the batch file it needs to be escaped by using %% instead of %. This is not necessary when using rclone at the command line. My final question was whether there is a way to work around the need to escape the percent character in the batch file. This is only to perfect your batch file, the issue has been otherwise resolved and I thank you for your help.
To close this out: I could not figure out how to avoid having to escape the percent character. So I went with @ncw suggestions to pipe in the passwords from text files password.txt and password2.txt, pipe out to a temporary text files, and then read that in with the FOR command using the "more". This seems to work fine. Here is the final batch file:
@echo off
set source=C:\Users\xyz\Desktop\rclone\src
set dest=C:\Users\xyz\Desktop\rclone\dst
set rclone_config_thecrypt_type=crypt
set rclone_config_thecrypt_remote=%source%
set rclone_config_thecrypt_filename_encryption=off
set rclone_config_thecrypt_directory_name_encryption=false
rclone obscure - < password.txt > tmp.txt
FOR /F "tokens=* USEBACKQ" %%F IN (`more tmp.txt`) DO (SET password=%%F)
set rclone_config_thecrypt_password=%password%
rclone obscure - < password2.txt > tmp.txt
FOR /F "tokens=* USEBACKQ" %%F IN (`more tmp.txt`) DO (SET password2=%%F)
set rclone_config_thecrypt_password2=%password2%
del tmp.txt
rclone copy THECRYPT: %dest%
set source=C:\ex\testcrypt\source
set dest=C:\ex\testcrypt\dest
set rclone_config_thecrypt_type=crypt
set rclone_config_thecrypt_remote=%source%
set rclone_config_thecrypt_filename_encryption=standard
set rclone_config_thecrypt_directory_name_encryption=true
rclone obscure - < pwd.txt > password.txt & @set /p rclone_config_thecrypt_password= < password.txt & del password.txt
rclone obscure - < pwd2.txt > password2.txt & @set /p rclone_config_thecrypt_password2= < password2.txt & del password2.txt
rclone copy thecrypt: %dest%
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.