Hi
I have Windows 7 installed with all updates up to date.
I have written 2 different batch files to upload a file to two differnet web servers.
Everything in the 2 files are similar except for the web server address, login name and password.
When running the second file it keeps the log in details and password of the first file - as if the info is in cache.
Here is the code:
@echo off
setlocal
set FILENAME="c:\temp\xyz.gz"
REM The file is located in this folder
rem cd \%PLATFORM%
::Variables
set f=%temp%\ftpc.txt
::Compose ftp commands file
echo open http://www.xyz.co.za>>%f%
echo user username1 password1>>%f%
echo binary>>%f%
REM This is the file you want to upload
echo put %FILENAME%>>%f%
echo bye>>%f%
::Execute ftp command
::Use "-d" key for verbose output
ftp -n -d -s:%f%
endlocal
:END
What am I doing wrong?
Any help will be much appreciated.
Problem with my batch files
Moderator: DosItHelp
Re: Problem with my batch files
i didn't understand exactly what is the problem but u can have a look at this topic:
http://www.dostips.com/forum/viewtopic.php?f=3&t=2081
and this is samples of ftp scripts:
http://www.dostips.com/DtTipsFtpBatchScript.php
http://www.dostips.com/forum/viewtopic.php?f=3&t=2081
and this is samples of ftp scripts:
http://www.dostips.com/DtTipsFtpBatchScript.php
Re: Problem with my batch files
blackgolf wrote:When running the second file it keeps the log in details and password of the first file - as if the info is in cache.
::Compose ftp commands file
echo open http://www.xyz.co.za>%f%
ftp -n -d -s:%f%
del %f% 2>nul
What am I doing wrong?
I suspect the two changes above will help.
Re: Problem with my batch files
You are a S T A R foxidrive, thanks a lot it does the trick.
Regards
Chris
Regards
Chris