Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can a script be forced to resume before it wants to?

3 views
Skip to first unread message

imaciscoguy

unread,
Mar 30, 2007, 8:17:50 PM3/30/07
to
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.

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__________

imaciscoguy

unread,
Mar 30, 2007, 8:18:15 PM3/30/07
to
0 new messages