I want to make a program that will sync two folders together with the command in cmd called xcopy, so when i click on a sync logo the folders sync. But i want the user to be able to browse for the locations then set the locations as they sync folders. I already have linked two FolderBrowserDialogs to two textboxes so when i select a folder in the browser the directory shows in the text box. But then how do i put the two directories into the xcopy command? This is what i have done so far...
I want the C:\folder1 to show up as whats in the TextBox1 and the c:\folder2 to show up as whats in the TextBox2.Code:Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click FolderBrowserDialog1.ShowDialog() TextBox1.Text = FolderBrowserDialog1.SelectedPath End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click FolderBrowserDialog2.ShowDialog() TextBox2.Text = FolderBrowserDialog2.SelectedPath End Sub Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click Shell("CMD.exe") SendKeys.Send("xcopy C:\folder1 C:\folder2 /D /E") SendKeys.Send("xcopy C:\folder2 C:\folder1 /D /E") SendKeys.Send("{ENTER}") SendKeys.Send("EXIT") End Sub End Class
Thanks Alot
PLEASE HELP!





Reply With Quote