RoboSharp icon indicating copy to clipboard operation
RoboSharp copied to clipboard

Only first folder gets copied.

Open LimitedModz opened this issue 2 years ago • 1 comments

Hi, I'm really inexperienced and just starting to learn programming. I'm using Visual Studio 22 and trying to create a WPF App (.NET Framework). When the application is finished, you should be able to use robocopy with a simple graphical interface.

image

As soon as I press the button "copy" the application opens again, only the first folder is copied, no subfolders or files are copied. But only if the textboxes contain a path. If they are empty nothing happens.

I use the following code:

    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
        private void Button_Copy_Click(object sender, RoutedEventArgs e)
        {

            RoboCommand copy = new RoboCommand();
            
            copy.CopyOptions.Source = TxtbxSrc.Text;
            copy.CopyOptions.Destination = TxtbxDst.Text;
            
            copy.CopyOptions.CopySubdirectoriesIncludingEmpty = true;
            copy.CopyOptions.EnableRestartMode = true;
            copy.CopyOptions.UseUnbufferedIo = true;

            copy.RetryOptions.RetryCount = 1;
            copy.RetryOptions.RetryWaitTime = 2;
            copy.Start();
        }

What could I be overlooking here?

LimitedModz avatar Jul 29 '22 13:07 LimitedModz

You've already set the CopySubDirectory flag true, so that should handle the effect you are trying to get.

RoboSharp by default creates the top-level directory always, then lets RoboCopy fill it up. If this is what you are seeing, then robocopy is likely encountering an error. You should await the start task, then examine the results.

RFBomb avatar Aug 19 '22 19:08 RFBomb

Closed as no response in 12 months - OP can reopen if still an issue

PCAssistSoftware avatar Aug 18 '23 10:08 PCAssistSoftware