Stap 5: Script zonder de commentaar
' Uw VB vóór de FTP upload Dim MyDirectory als String Dim File1 AsIntegerDim File2 als IntegerFile1 = FreeFileFile2 = FreeFile ' dit wijzigen in een map van uw keuze ‘Your VB before the FTP upload Dim MyDirectory As String Dim File1 AsIntegerDim File2 As IntegerFile1 = FreeFileFile2 = FreeFile ‘Change this to a directory of your choosing MyDirectory = “C:\Temp\FTPFiles" ‘Kill existing .out filesIf Dir(MyDirectory & ".out") <> "" Then Kill (MyDirectory & ".out") Open MyDirectory & ".txt" For Output As #File1 ‘Put your ftp server address herePrint #File1, "open ftp.myserver.com" ‘Put your user name herePrint #File1, “my_username” ‘Put your password herePrint #File1, “my_password” ‘Change your remote directory. Omit this line if root is fine.Print #File1 “cd my/remote/directory/” ‘Add your list of files here using put or mput with wildcard if neededPrint #File1, “put C:/MyFiles/thisfile1.png”Print #File1, “put C:/MyFiles/thisfile2.png” Print #File1, "bye"Close #File1 Open MyDirectory & ".bat" For Output As #File2Print #File2, "ftp -s:" & MyDirectory & ".txt"Print #File2, "Echo ""Complete"" > " & MyDirectory & ".out" Close #File2 ‘Execute the bat fileShell (MyDirectory & ".bat"), vbNormalFocus Do While Dir(MyDirectory & ".out") = "" DoEvents Loop Application.Wait (Now + TimeValue("0:00:03")) ‘Delete the batch filesIf Dir(MyDirectory & ".bat") <> "" Then Kill (MyDirectory & ".bat")If Dir(MyDirectory & ".out") <> "" Then Kill (MyDirectory & ".out")If Dir(MyDirectory & ".txt") <> "" Then Kill (MyDirectory & ".txt") ‘Your VB after the upload ' Doden van bestaande .out filesIf Dir (MyDirectory & ".out") <> "" dan doden (MyDirectory & ".out")' Zet uw FTP-server adres herePrint #File1, "open ftp.myserver.com" "zetten van uw gebruiker naam herePrint #File1,"my_username"' zet uw wachtwoord herePrint #File1,"mijn_wachtwoord"' wijzigen van uw externe map. Weglaten van deze regel als wortel prima is. Afdrukken van #File1 "cd mijn afstandsbediening/map / /" ' toevoegen van uw lijst van de bestanden hier zetten of met mput jokertekens als neededPrint #File1, "C:/MyFiles/thisfile1.png"Print #File1, "zet C:/MyFiles/thisfile2.png" zetten Print #File1, "bye" Close #File1 Open MyDirectory & "bat" voor uitvoer als #File2Print #File2, "ftp - s:" & MyDirectory & ".txt" afdrukken #File2, "Echo""Complete" ">" & MyDirectory & ".out" sluit #File2 ' uitvoeren van de vleermuis-fileShell (MyDirectory & "bat") , vbNormalFocus doen terwijl Dir(MyDirectory & ".out") = "" DoEvents lus