RoboSharp
RoboSharp copied to clipboard
Only first folder gets copied.
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.
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?
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.
Closed as no response in 12 months - OP can reopen if still an issue