Start New Discussion within our Software Development Community

Hello all,
i need to creates an automated form that detect the current destination path of the application setup wizard and copies a certain folder then asks where to save this folder so i can use it in a setup wizard.

i hope that my question is clear and thanks in advance. :)

you can use this code.. this code can copy the file you want and save it onto a folder.

Try



            find = New OpenFileDialog

            find.FileName = ""

            find.Filter = "File Formats(*.pdf;*.xlsx;*.xls)|*.pdf;*.xlsx;"



            If find.ShowDialog = Windows.Forms.DialogResult.OK Then


                filename = find.FileName.ToString


                specific = find.SafeFileName.ToString


                txtFilePath.Text = find.FileName


                placeto = New FolderBrowserDialog

                If placeto.ShowDialog = Windows.Forms.DialogResult.OK Then
                    txtFilePath.Text = placeto.SelectedPath.ToString & "\" & specific
                    specific2 = placeto.SelectedPath.ToString & "\" & specific
                End If



                If txtFilePath.Text = "" Then
                    MessageBox.Show("No File to be copied.")
                Else

                    My.Computer.FileSystem.CopyFile(sourceFileName:=filename, destinationFileName:=specific2, showUI:=FileIO.UIOption.AllDialogs)
                    MessageBox.Show(UCase(specific) & " was successfully copied to " & UCase(placeto.SelectedPath.ToString) & ".")
                End If
            End If

        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
This article has been dead for over six months. Start a new discussion instead.