Executing rclone command in Window Form application is failed

What is the problem you are having with rclone?

I am trying to execute the command of "rclone config" in Window Form application by Process class with c#.

  1. Go to the c:\rclone folder. It is succesful.
    The code is as below:
    Process process = new Process();
    process.StartInfo.FileName = "cmd";
    process.StartInfo.Arguments = @"/A /C cd C:\rclone";
    process.Start();
    ...
  2. Execute "rclone config" command. It is failed.
    The code is as below:
    process.StartInfo.FileName = "cmd";
    process.StartInfo.Arguments = @"/A /C rclone config";
    process.Start();
    ...

How can I execute correctly the rclone command in Window form application?

What is your rclone version (output from rclone version)

v1.53.1

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Windows 10, 64 bit

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

The rclone config contents with secrets removed.

Paste config here

A log from the command with the -vv flag

Paste  log here

Hi, welcome to the forum.

You would have to set the working directory in your step 2, and drop step 1:

process.StartInfo.WorkingDirectory = @"C:\rclone";

It is a bit off topic question in this forum, you would probably be better off if you found a good tutorial or something for running any kind of command line applications from C#.

Thank you for your advise!
I revised it as you said.

I solved it like below:
process.StartInfo.FileName = "cmd";
process.StartInfo.Arguments = @"/A /K rclone config";
process.StartInfo.WorkingDirectory = @"C:\rclone";
process.Start();
...

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.