Re: ftp via bat called by wsh
From: Torgeir Bakken \(MVP\) (Torgeir.Bakken-spam_at_hydro.com)
Date: 01/12/05
- Next message: Kim: "Re: ftp via bat called by wsh"
- Previous message: Kim: "ftp via bat called by wsh"
- In reply to: Kim: "ftp via bat called by wsh"
- Next in thread: Kim: "Re: ftp via bat called by wsh"
- Reply: Kim: "Re: ftp via bat called by wsh"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 13 Jan 2005 00:27:02 +0100
Kim wrote:
> I am ftping a directory of files using a bat file called from a wsh file.
>
> All is working fine with one exception.
>
> I cannot get the ftp command line to close when using MPUT - the ftp
> command to upload multiple files.
>
> It will work if I use PUT with one file.
>
> this is the contents of the bat file
> ftp -s:filename.txt myftpsite.com
>
> below are two version of the commands within the filename.txt referenced
> above..
>
> this will not work... It uploads no files and does not close the ftp
> connection.
>
> username
> password
> binary
> CD ecreditexperts
> CD www
> CD admin
> CD doc
> mput "D:\work_tasks\cpi_sales\sales\*.Doc"
> bye
Hi
This is because the mput command is default interactive (it will
ask for each file). This asking is what hangs your script.
You can suppress interaction for ftp.exe two different ways:
1)
Add -i to the command line, like this:
ftp.exe -i -s:filename.txt myftpsite.com
2)
In your filename.txt input file, add the command "prompt", like this
(the ftp command prompt toggles the interaction bit off and on each
time you run it, so be sure to add it only once in the file):
username
password
prompt
binary
CD ecreditexperts
CD www
CD admin
CD doc
mput "D:\work_tasks\cpi_sales\sales\*.Doc"
bye
-- torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway Administration scripting examples and an ONLINE version of the 1328 page Scripting Guide: http://www.microsoft.com/technet/scriptcenter/default.mspx
- Next message: Kim: "Re: ftp via bat called by wsh"
- Previous message: Kim: "ftp via bat called by wsh"
- In reply to: Kim: "ftp via bat called by wsh"
- Next in thread: Kim: "Re: ftp via bat called by wsh"
- Reply: Kim: "Re: ftp via bat called by wsh"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|