Link to home
Start Free TrialLog in
Avatar of rrhandle8
rrhandle8Flag for United States of America

asked on

VBS script FTPs only part of the file's content

I have a list of files to be FTPed from one server to another.  This process had been working.  Recently, only part of each file was successfully sent.  The files are all 20-30kb.  When sent to the 2nd server, only 3-6kb of each file shows up.

The script loops through the list of files and uses this code to FTP them:
Set objshell _ Createobject("wscript.shell")
objshell.run "ncftpput.exe (server stuff and file names)
set objshell = nothing

Open in new window


I tried to slow the process down by adding a msgbox and it worked:
Set objshell _ Createobject("wscript.shell")
objshell.run "ncftpput.exe (server stuff and file names)
set objshell = nothing
msgbox "Press ENTER to continue"

Open in new window


Next, I tried the sleep command to delay it by 20seconds. It did not work. Only parts of the files were transfered.
Set objshell _ Createobject("wscript.shell")
objshell.run "ncftpput.exe (server stuff and file names)
wscript.sleep 20000
set objshell = nothing

Open in new window

Avatar of rrhandle8
rrhandle8
Flag of United States of America image

ASKER

objshell.run has really three parameters. The last one is bWaitOnReturn. It is false by default.  Your command would become something like: objshell.run "ncftpput.exe [...]",,true
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.