Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pause Script Until File Transfer Is Complete 1

Status
Not open for further replies.

AGNEW2PRG

Technical User
Aug 5, 2003
98
AE
Hi,

I have written a script to upgrade firmware on a device. The script works as expected. However, the firmware is approx 27mb and the statements after the put command executes before the file is successfully transfered to the device. is there any way i can halt the script until the file transfer is complete.

Thanks In Advance

<--------------- Script Start ------------------------->
NAME=HostIP
Set sh=wscript.createobject("wscript.shell")
sh.run("ftp " + name)
wscript.sleep(1000)
sh.sendkeys (CR)
wscript.sleep(1000)
sh.sendkeys (CR)
wscript.sleep(1000)
sh.sendkeys "bin" & (CR)
sh.sendkeys "put C:\FWCONFIG\Firmware\9XXX.rfu" & (CR)
wscript.sleep(1000)
sh.sendkeys "bye" & (CR)

<-------------- Script End ----------------------------->
 
sh.run "ftp " & name, , True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Create a file with the ftp commands and then:
sh.run "ftp -s:C:\commands.ftp " & name, , True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

Thanks for your advice, do you mean have all the send key lines in a text file?

Regards


" New To Programming - Learning Fast :)
 
Create a file named, say, commands.ftp:
USER logname password
BIN
PUT C:\FWCONFIG\Firmware\9XXX.rfu
BYE

Then your script:
Set sh = CreateObject("WScript.Shell")
sh.Run "ftp -n -s:commands.ftp " & HostIP, , True

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,

Firstly, thanks for all the help. Please could you let me know if the below is right.Also, what do the -n and -s switches do?

Regards
AGNEW2PRG
<----------- VBS File ------------->

Sub FWUPD

Set sh = CreateObject("WScript.Shell")

sh.Run "ftp -n -s C:\FWCONFIG\Firmware\commands.ftp " & HostIP, , True

MsgBox "FIRMWARE UPDATED"

End Sub

<---------- commands.ftp ----------------->

jbloggs
passw0rd
binary
put C:\FWCONFIG\Firmware\9XXX.rfu
bye


 
In a console window type the following:
ftp -?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
PHV,

That worked.. Thanks for all your help...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top