Quote:OK...
I'm using now a Sample bat which is the following...:
@echo off
GOTO EndRemarks
After you changed this script, you should remove everything BEFORE the line that reads "@echo off" above.
This bat-file will automatically ftp new files to an ftp-server.
It uses the ftp program as provided by Microsoft.
This .bat file has some simple checks to see if you have configured it properly.
When a check fails, a message will popup to warn you.
These checks can be disabled by setting the DEBUGBAT option to N.
:EndRemarks
REM ==================================================
REM = CHANGE THE STATEMENTS BELOW FOR YOUR SITUATION =
REM ==================================================
REM DEBUGBAT
REM If this option is set to Y, this .bat file will perform some
REM simple checks to see if it is configured properly.
REM If a problem is detected, a message will popup to warn you.
REM When you are satisfied with your settings, you should
REM set this option to a value other than Y.
SET DEBUGBAT=Y
rem
rem FTPSERVER
rem the ftp server name
rem if you need to include a port number, separate the server and port
rem with a space - not a colon (

SET FTPSERVER=195.XXX.XXX.XXX
rem
rem FTPUSER
rem The userid to use for logging in
SET FTPUSER=xxx
rem
rem FTPPASS
rem The password to use for logging in
SET FTPPASS=xxxxxxxx
rem
rem FTPDIR
rem The directory on the ftp-server where
rem the files should be stored
SET FTPDIR=/xxxxx
rem
rem FTPTEMP
rem Enter the name of a directory where
rem this bat-file can write temporary files
rem Do NOT end the directory-name with a backslash (\)
SET FTPTEMP=C:\TMP
REM ================================================
REM = NO NEED TO CHANGE ANYTHING BELOW THESE LINES =
REM ================================================
REM check settings of this .bat file
SET BATERROR=N
IF "%DEBUGBAT%" == "Y" (
CALL :CheckBatSettings
)
IF %BATERROR% == Y GOTO

one
rem only for new files
IF %WD_REASON% == FILENEW GOTO FtpTheFile
Echo Only NEW files will be ftp-ed...
GOTO Done
:FtpTheFile
rem change to the directory of the new file
rem WD_FILE_D contains the directory where the new file
rem is located.
rem If the new file is C:\TEMP\File.ext this variable will contain C:\TEMP
cd "%WD_FILE_D%"
rem now build a response file containing the FTP commands
SET RESFI="%FTPTEMP%\%WD_FILE_B%.TMP"
ECHO verbose off > %RESFI%
ECHO open %FTPSERVER% >> %RESFI%
ECHO user %FTPUSER% %FTPPASS% >> %RESFI%
ECHO bin >> %RESFI%
ECHO cd %FTPDIR% >> %RESFI%
ECHO put "%WD_FILE_N%" >> %RESFI%
ECHO quit >> %RESFI%
rem ok, we created a file we want to be executed by ftp
rem start ftp
rem -n means suppress autologin
rem -s:c:\temp\ftp.in means take commands from that file
ftp -n -s:%RESFI%
del %RESFI%
rem Done!
GOTO Done
rem ==== CheckBatSettings
rem this subroutine is called if DEBUGBAT equals Y
rem it performs some simple checks to see if this .bat file
rem is properly setup
GOTO

one
:CheckBatSettings
IF NOT EXIST "%FTPTEMP%\." (
SET BATERROR=Y
"%WD_INSTDIR%\MBox.exe" "The variable FTPTEMP is not set correctly" -caption "Configuration problem" -icon ! -type ok
GOTO :Eof
)
GOTO :Eof

one
---------------------------------------
Where do i need the bat for connecting and put files to Secure FTP Server using WinSCP?