Computer Hope

Microsoft => Microsoft DOS => Topic started by: inciravek on September 24, 2021, 03:07:29 PM

Title: how to run an ftp script silently?
Post by: inciravek on September 24, 2021, 03:07:29 PM
Hi all, so I am trying to run a batch file to upload file via ftp using an ftp utility called cmdftp. It is almost the same as window's native ftp. I know how to run the batch file silently, but the batch file calls a text script that I don't know how to hide (so whenever this file runs, the command line windows will pop up until it is finished)

the batch file is (you can actually replace cmdftp with ftp)
Code: [Select]
cmdftp -s:ftpscript.txt -d:"Log.txt"
the script is

Code: [Select]
open ftp.drivehq.com
USERNAME
xxxxxxxxx
cd test
delete orders.xml.bak
rename orders.xml orders.xml.bak
put c:\test\orders.xml
quit

I think i need to add something to the script file to make it run silently but I don't know what, @echo off doesn't work. Any help is greatly appreciated!
Title: Re: how to run an ftp script silently?
Post by: Squashman on September 28, 2021, 07:24:40 AM
Did you try redirecting everything to NUL?

Code: [Select]
@cmdftp -s:ftpscript.txt > NUL 2>&1