diff --git a/path/winbug.go b/path/winbug.go index ddb423b4..353b7a28 100644 --- a/path/winbug.go +++ b/path/winbug.go @@ -44,12 +44,12 @@ func CustomRemoveAll(p string) error { // Handle the windows case first if runtime.GOOS == "windows" { msg.Debug("Detected Windows. Removing files using windows command") - cmd := exec.Command("cmd.exe", "/c", "rd", "/s", "/q", p) + cmd := exec.Command("cmd.exe", "/c", "xcopy /s/y", o, n+"\\") output, err := cmd.CombinedOutput() if err != nil { exitCode := getExitCode(err) if exitCode != winErrorFileNotFound && exitCode != winErrorPathNotFound { - return fmt.Errorf("Error removing files: %s. output: %s", err, output) + return fmt.Errorf("Error removing MY files: %s. output: %s", err, output) } } return nil @@ -72,10 +72,10 @@ func CustomRename(o, n string) error { // Handking windows cases first if runtime.GOOS == "windows" { msg.Debug("Detected Windows. Moving files using windows command") - cmd := exec.Command("cmd.exe", "/c", "move", o, n) + cmd := exec.Command("cmd.exe", "/c", "xcopy /s/y", o, n+"\\") output, err := cmd.CombinedOutput() if err != nil { - return fmt.Errorf("Error moving files: %s. output: %s", err, output) + return fmt.Errorf("Error moving MY files: %s. output: %s", err, output) } return nil