0

Basically, what I want to do is...

Have a listbox with a list of directories and the executable name in, e.g.
"C:\Directory1\file.exe"
"C:\Directory2\file.exe"
"C:\Directory3\file.exe"

And then using
My.Computer.FileSystem.CopyFile(Application.ExecutablePath, [Each List Item Here], True)

To copy itself to the directories I want to :)


How can this be done?
Thanks

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by sknake
0

It's a custom installer for my program.
I need it to copy itself to the directories of previous versions and overwrite the files to update :)

0
Imports System.IO

Public Class Form1

	Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
		For Each itm As Object In ListBox1.Items
			Dim fName As String = Convert.ToString(itm)
			If (File.Exists(fName)) Then
				File.Delete(fName)
			End If
			System.IO.File.Copy(Application.ExecutablePath, fName)
		Next
	End Sub
End Class
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.