Greetings all.
Please could anyone help, Newbee to VB having trouble with this peace of code. The problem is that I am unabe to get file from remote server. This code works the only problem is that I am unable to work out how to get a file. How would I express the first line to point to remote server.
* For Each fil in filc
* if right(fil.name,3) = "cdr" THEN
* f_out.writeline("get " & fil.name)
* END if
* Next
* Count = Count + 1
const root = "D:\ivr\FTP\ToVertex"
const scriptnam = "D:\ivr\FTP\WHS\msgup.ftp"
const ftplog = "D:\ivr\FTP\WHS\ftp.log"
Dim server(5)
Dim Count
Server(0) = "RETBOLTSIVRV1"
Server(1) = "RETBOLTSIVRV2"
Server(2) = "RETRAYLSIVRV1"
Server(3) = "RETRAYLSIVRV2"
Server(4) = "RETBEDFSIVRV1"
Server(5) = "RETBEDFSIVRV2"
Count = 0
set fs = CreateObject("Scripting.FileSystemObject")
set f_log = fs.OpenTextFile(ftplog,8,TRUE) ' Open in append mode
f_log.writeline("")
f_log.writeline("=============================")
f_log.writeline("New ftp session " & now())
f_log.writeline("=============================")
f_log.close
set startfolder = fs.GetFolder(root)
set filc = startfolder.Files
set f_out = fs.CreateTextFile(scriptnam,TRUE)
f_out.writeline("open Server")
f_out.writeline("user user password")
f_out.writeline("lcd d:\ivr\FTP\FromVertex")
Do Until count = 5
f_out.writeline("cd /home/ivrftp/FromVertex/" & server(Count))
For Each fil in filc
if right(fil.name,3) = "cdr" THEN
f_out.writeline("get " & fil.name)
END if
Next
Count = Count + 1
Loop
f_out.writeline("close")
f_out.writeline("bye")
f_out.Close
Please could anyone help, Newbee to VB having trouble with this peace of code. The problem is that I am unabe to get file from remote server. This code works the only problem is that I am unable to work out how to get a file. How would I express the first line to point to remote server.
* For Each fil in filc
* if right(fil.name,3) = "cdr" THEN
* f_out.writeline("get " & fil.name)
* END if
* Next
* Count = Count + 1
const root = "D:\ivr\FTP\ToVertex"
const scriptnam = "D:\ivr\FTP\WHS\msgup.ftp"
const ftplog = "D:\ivr\FTP\WHS\ftp.log"
Dim server(5)
Dim Count
Server(0) = "RETBOLTSIVRV1"
Server(1) = "RETBOLTSIVRV2"
Server(2) = "RETRAYLSIVRV1"
Server(3) = "RETRAYLSIVRV2"
Server(4) = "RETBEDFSIVRV1"
Server(5) = "RETBEDFSIVRV2"
Count = 0
set fs = CreateObject("Scripting.FileSystemObject")
set f_log = fs.OpenTextFile(ftplog,8,TRUE) ' Open in append mode
f_log.writeline("")
f_log.writeline("=============================")
f_log.writeline("New ftp session " & now())
f_log.writeline("=============================")
f_log.close
set startfolder = fs.GetFolder(root)
set filc = startfolder.Files
set f_out = fs.CreateTextFile(scriptnam,TRUE)
f_out.writeline("open Server")
f_out.writeline("user user password")
f_out.writeline("lcd d:\ivr\FTP\FromVertex")
Do Until count = 5
f_out.writeline("cd /home/ivrftp/FromVertex/" & server(Count))
For Each fil in filc
if right(fil.name,3) = "cdr" THEN
f_out.writeline("get " & fil.name)
END if
Next
Count = Count + 1
Loop
f_out.writeline("close")
f_out.writeline("bye")
f_out.Close