RayT
asked on
Running RoboCopy from Visual Basic Application
I need help with the following code. Both SourceFile and TargetFile contains spaces. How do I make this work? Currently it does nothing.
Dim RoboCopyArgs As New StringBuilder
With RoboCopyArgs
.Clear()
.Append("""")
.Append(SourceFile)
.Append("""")
.Append(" ")
.Append("""")
.Append(TargetFile)
.Append("""")
.Append(" /S /E ")
End With
Dim proc As Process = Process.Start("C:\Windows\ SysWOW64\R obocopy.ex e", RoboCopyArgs.ToString)
proc.Start()
proc.Close()
Dim RoboCopyArgs As New StringBuilder
With RoboCopyArgs
.Clear()
.Append("""")
.Append(SourceFile)
.Append("""")
.Append(" ")
.Append("""")
.Append(TargetFile)
.Append("""")
.Append(" /S /E ")
End With
Dim proc As Process = Process.Start("C:\Windows\
proc.Start()
proc.Close()
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks! I've got to start reading these manuals :)
anytime buddy
have a good day
have a good day
You need to use a /MIR /Copy or a /Copyall switch.
I think a /dcopy can be used too