How to run rclone commands in C# Process

0

 Rclone is a program which manages the files on the cloud storage . It is an open source software so that anyone can  use it . By using this software we can copy the files , move the files from one drive to another drive . We can also perform the other operations like sync , mount the drives . It supports over 40 cloud storage products , including the best cloud storage services from Google , Amazon , Mega Dropbox etc . 

Rclone is available for the Windows , Linux , macOS , Debian and several others . 


How to run rclone commands in C# :

To run the rclone commands first we need to import the library . 


//Import System.Diagnostics library

using System.Diagnostics;


Once we have imported the library then we need to create namespace . Then we create a class .

Now inside the main method we create Process object.


Process proc = new Process
            {
                StartInfo = new ProcessStartInfo
                {
                    FileName = "D:\\rclone.exe", //I have installed rclone there
                    Arguments = @"lsd C:\\Users"// You can pass arguements here
                    UseShellExecute = false,
                    RedirectStandardOutput = true,
                    CreateNoWindow = true                
                 }
            };


So now we have created initialized the process object . Now we will start the process


//Start your process here

proc.Start( );



So now rclone.exe will run and will run the lsd command on the C:\\Users directory .

So in this way you can run rclone commands in C# process.





Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !