I'm creating an application in Visual Studio. When the user clicks a button, I want the follow CMD command to be executed:
xcopy /s/y "C:\myfile.txt" "D:\"
I've tried this with Process.Start() but it won't work. The button code is:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Process.Start("CMD", "/C xcopy /s/y "C:\myfile.txt" "D:\"")
End Sub
Does anyone know how I can make this work? I suspect that the problem is caused by the /s/y parameters or quotes in the CMD command.