Se mi permettete posto la soluzione finale, a qualcuno potrebbe servire.
@Gibra, perch� a volte, e credo lo faccia quando la cartella di destinazione � aperta crea il file finale "Pippo.txt" COME CARTELLA Pippo.txt (vuota)?
Segue soluzione finale:
Dim dir As String = ("QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxc vbnm")
Dim proceed As Boolean
Dim firstletter As String = FilesListBox.SelectedItem.ToString.Chars(0)
If dir.ToString.Contains(firstletter) Then
proceed = True
firstletter = firstletter & ":\"
Else
proceed = False
End If
If proceed = True Then
Dim Startfolder As String = firstletter
Dim Targetfolder As String = "C:\Users\Public\Documents\Software\"
' My.Computer.FileSystem.CurrentDirectory + "\Software\"
Dim Finalfolder As String = Replace(FilesListBox.SelectedItem, Startfolder, Targetfolder)
Call Copy(FilesListBox.SelectedItem, Finalfolder) ' copy file in a folder
MsgBox("The file has been copied to:" & vbCrLf & Finalfolder.ToString)
End If

Rispondi quotando