Can I be Helped???
This is part of my FTP script that connects to multiple Computers (as
determined by a machine.txt file) and retrieves a file from each
computer with all having the same name. The script then renames that
file to the computer name, date and time.
My problem is when one of the computers is not available, the script
hangs while attempting to get that file then errors out because it is
trying to rename a file that does not exist.
I know that you can use "on error resume next" with regard to renaming
a file that does not exist,
but I would still like to make it continue after only a few seconds.
My questions;
Can you tell it to "On error resume next" say after only 3 or 4
seconds.
or can I tell it "On error to Cleanup files" and goto Next to
continue
loop.
Thanks so much,
Cisco
'__________________________________________________
' now run the FTP batch file created above
' create a shell and run the batch file
'_________________________________________________
Set oShell = WScript.CreateObject ("WSCript.shell")
oShell.run strFTPBat,0,TRUE
Set oShell = Nothing
'_____________________________________
'Cleanup files
'_______________________________________
fso.DeleteFile strFTPBat,1
fso.DeleteFile strResponseFile,1
'______________________________________________
'Rename the Files
'_____________________________________________
set fso = createobject("scripting.filesystemobject")
set file = fso.getfile("machine.ini")
mybase = fso.getbasename(file.name)
myext = fso.getextensionname(file.name)
mysuffix = replace(formatdatetime(now(),vbShortdate),"/","-")
mytime = replace(formatdatetime(now(),vbLongTime),":","-")
file.name = mybase & strFtpHost & "-" & mysuffix & "-" & mytime & "."
& myext
'file.name = mybase & strFtpHost & "-" & mysuffix & "." & myext
'msgbox file.name
'______________________________________________
'Continue Loop
'_______________________________________________
Next
'____________End Of Script__________