Help with VB script (file copying)

Associate
Joined
8 Mar 2007
Posts
2,176
Location
between here and there
i'm having some problems with a VB script that copies a batch file from onr machine to another.

this is what i have so far....

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim fso
fso = CreateObject("Wscript.Shell")

fso.CopyFile("c:\batch\remote.bat, \\10.1.0.100\c\remote.bat")
MessageBox.Show("Transfer Completed")

however this doesn't seem to work.

as you can tell i'm new to all of this but willing to learn. I've done th google thing but thats onlt left me feeling more confused.

please help!!!
 
ok, so i managed to get it to copy from one dir to another but i'm having problem copying across a network.

any ideas?

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim fso
Const OverwriteExisting = True
fso = CreateObject("Scripting.FileSystemObject")
fso.CopyFile("C:\batch\remote.bat", "\\10.1.0.100\c$\remote.bat", OverwriteExisting)
MessageBox.Show("Transfer Complete")
 
Back
Top Bottom