How to configure rclone via environment variables over Windows for GDrive

Hi,

We would like to run rclone via environment variables over windows for GDrive

Since we are calling rclone from cmdlet it gives following error.
2017/09/15 18:36:51 ERROR : Failed to save new token in config file: section ‘MYDRIVE’ not found

What is the true way to apply environmental variable for gdrive to work correctly with refresh tokens
Here is my code

set RCLONE_DRIVE_USE_TRASH=true
set RCLONE_CONFIG_MYDRIVE_TYPE=drive
set RCLONE_CONFIG_MYDRIVE_CLIENT_ID=
set RCLONE_CONFIG_MYDRIVE_CLIENT_SECRET=
set RCLONE_CONFIG_MYDRIVE_TOKEN=
{“access_token”:“x”,“token_type”:“Bearer”,“refresh_token”:“y”,“expiry”:“2017-09-15T12:24:11.5476246+03:00”}
rclone lsd MYDRIVE:

Thanks in advance.

That ERROR is non fatal and doesn’t affect the exit code - rclone should carry on working OK afterwards. I agree it isn’t ideal though!

Is that what you find - that rclone works OK?

Note that you can use mydrive: rather than MYDRIVE: if you want.

I appreciated for your help.

Would you please condirm If I use My Own CLIENT_ID and CLIENT_SECRET (GDrive)
I will need access_token or refresh_token also?

Yes you will need the access_token and refresh_token.