0

I have an app. when on click it will transfer all text files to server but it replaces the old files. I want to transfer the new files without replacing the old files.

here is my code that when you click the command key and will run the command shell:

pscp -pw password *.txt server@ipaddress:/path

for example. i have a file named "filename_0000.txt" and "filename_0001.txt" transfered on the server. then I will transfer a new file also named "filename_0000.txt". the result should be

filename_0000.txt
filename_0000(1).txt or filename_0000_1.txt
filename_0001.txt

here is the vb6 code

Private Sub Command1_Click()
    res = Shell("cmd /c " & Trim(Text1.Text) & " >> " & App.Path & "\dir.txt")
    Timer2.Enabled = True
End Sub

Private Sub Timer2_Timer()
Open App.Path & "\dir.txt" For Input As #1
Do While Not EOF(1)
    Input #1, c
    List1.AddItem c
Loop
Timer2.Enabled = False
Close #1
End Sub
Vincent
  • 103
  • 1
  • 4

0 Answers0