问题
I using robocopy to copy file from a Share folder "\\192.168.1.112\Share"
to local folder "C:\test"
This is my code:
Dim strCMD="robocopy "\\192.168.1.112\Share" "C:\test" /MIR /NP /NDL /NFL /R:3 /W:1 /DCOPY:T"
Dim oProcess As New Process()
Dim oStartInfo As New ProcessStartInfo("cmd.exe", " /C" & strCMD)
oStartInfo.UseShellExecute = False
oStartInfo.RedirectStandardOutput = True
oProcess.StartInfo = oStartInfo
oProcess.Start()
oProcess.WaitForExit()
'++*************************************
' Get ouput infor
'--*************************************
Dim sOutput As String
Using oStreamReader As System.IO.StreamReader = oProcess.StandardOutput
sOutput = oStreamReader.ReadToEnd()
End Using
oProcess.Close()
If folder "C:\test" is empty . it will working ok.
But if "C:\test" exist 1 original folder and 2 copy folder. cmd can't close.
Ex: Share folder:
\\192.168.1.112\Share\Translation
Local folder:
"C:\test\Translation"
"C:\test\Translation - Copy"
"C:\test\Translation - Copy (2)"
Why robocopy can't close cmd when delete folder?
来源:https://stackoverflow.com/questions/56055864/why-robocopy-cant-close-when-delete-folder