Jump to content

Recommended Posts

Posted

How to write a script or batch file, which compress files in a direcotry, then sends the compressed file through SmartFTP program, and then another script or batch file that check the file checksum??? How to configure SmartFTP that it can use that script for automated uploads??

  • 2 weeks later...

Posted

Most of it seems possible. However, if SmartFTP doesn't have a command-line mode, there's really nothing you can do to send a file through it. Maybe if you can find a command-line alternative to the program, I could do it for you.

Posted

Windows has built-in FTP utility named, not surprisingly, ftp.exe. With some echo commands in a batch file to create a script for it and then redirect ftp.exe's input from the script, it is possible to automate FTP'ing.

Posted

@echo off

set /P my_folder="Please enter folder to zip and FTP: "

if exist %my_folder% goto do_zfile

goto error

:do_zfile

cd %my_folder%

rem .: if your date has '/' in the date, they need to be stripped out.

for /f "delims='/'" %%i in ('%date%') do

set my_date=%%i-%%j-%%k

winzip32 -min -a -p -ex -hs *.* %my_date%.zip

set /P my_loc="Please enter FTP site: "

set /P my_id="Please enter your ID: "

set /P my_pass="Please enter your Password: "

echo open %my_loc% > ftp_conn.txt

echo user %my_id% %my_pass%>> ftp_conn.txt

echo binary >> ftp_conn.txt

echo hash >> ftp_conn.txt

echo put %my_date%.zip >> ftp_conn.txt

echo close >> ftp_conn.txt

echo quit >> ftp_conn.txt

ftp -s:ftp_conn.txt

del ftp_conn.txt

del %my_date%.zip

goto done

:error

echo Folder was not found.

:done

- This is my batch file for ftp program. I want uses that file with SmartFTP. And when I launch that file it asking me for a file… I’m typing C:\test\ - and it’s says that, the syntax of the command is incorrect. Why??? What is the correct command???

Posted

I would change this line

echo user %my_id% %my_pass%>> ftp_conn.txt

to

echo user %my_id% >> ftp_conn.txt
echo %my_pass% >> ftp_conn.txt

Posted
And when I launch that file it asking me for a file… I’m typing C:\test\
... that's not a path to a file, that's a path to a directory. If the file was named 'test' and in the root, then "c:\test" would be the path to it. If you wanted the entire directory, do "c:\test\*.*"

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...