WINDOWS COMMAND LINE FTP INSTRUCTIONS:

Windows Command Line Ftp software Commands:

set          set one or more arguments

syntax:

set [--argument parameters] [--argument paramters]...

set arguments:

set --host www.mydomain.com --port 21 --username david --password mypass

with empty parameter to clear the parameter or reset to default value:

# line starts with # is a comment line
# reset image and justprint to default value
set --image --justprint

connect      connect to remote server

syntax:

connect [--host host] [--port port]

example1:

connect --host www.mydomain.com --port 21

example2:

set --host 125.15.46.32 --port 21  
connect

login        login to remote server

syntax:

login [--username username] [--password password]

example1:

login --username david --password myPassword       

example2:

set --username david --password myPassword  
login

disconnect   terminate ftp session

syntax:

disconnect

quit         terminate ftp session and exit

syntax:

quit

get          receive one file

syntax:

get --src sourceFile [--dst destinationFile] [--image <true or false>] [--local localFolder]

save as a same name:

get --src "my customer.txt" --local "D:\My Documents\"

save as a different name :

get --src "my customer.txt" --dst MyCustomer.txt --local "D:\My Documents\"

put          send one file

syntax:

put --src sourceFile [--dst destinationFile] [--image <true or false>] [--local localFolder]

put the file on the server as a same name:

put --src myPicture.jpg --local "D:\My Documents\"

put the file on the server as a different name:

put --src myPicture.jpg --dst newPicture.jpg --local "D:\My Documents\"

dele         delete a file at remote

syntax:

dele --name file

example:

dele --name temp.doc

list         list contents of remote directory

syntax:

list [--name directory]

list contents of current directory:

list

list contents of specified directory:

list --name /home/dirname

nlst         list file names of remote directory

syntax:

nlst [--name directory]

list contents of current directory:

nlst

list contents of specified direstory:

nlst --name /home/dirname

mkd          create a directory at server

syntax:

mkd --name directory  

example:

mkd --name testdir

pwd          print working directory on remote machine

syntax:

pwd

rename       renames the remote file src to dst

syntax:

rename --src source --dst destination

example:

rename --src myfile.doc --dst work.doc

rmd          remove directory on the remote machine

syntax:

rmd --name directory [--recurse <true or false>] [--justprint <true or false>]

remove empty directory:

rmd --name tempdir --recurse false

just print all matched files and folders, but not actually delete them:

rmd --name "test dir" --recurse true --justprint true

remove directory and all sub-directories(be careful!):

rmd --name "test dir" --recurse true --justprint false

size         determine the size of a remote file

syntax:

size --name file

example:

size --name myfile.exe

mdtm         determine the modification date of a remote file

syntax:

mdtm --name file

example:

mdtm --name myfile.exe

syst         print the remote system type. e.g. UNIX

syntax:

syst

cwd          change path at remote

syntax:

cwd --name directory

example:

cwd --name newDirectory

cdup         move to parent directory at remote

syntax:

cdup

response     print the last response received

syntax:

response

home         open web browser on home page

syntax:

home

man          open web browser on manual page

syntax:

man

log          open FTP log file

syntax:

log

@cmdfile     read commands from @textfile

syntax:

@cmdfile

call from any software:

CmdFtp @mycmdfile.txt

call from any software(full path):

CmdFtp "@D:\my path\mycmdfile.txt"

Interactive:

 CmdFtp> @mycmdfile.txt

Interactive(full path):

 CmdFtp> "@D:\my path\mycmdfile.txt"

status       show current status and parameters for debug

syntax:

status

help         print local help information

syntax:

help

Windows Command Line Ftp Arguments:

host         host name or ip address

syntax:

--host host

example1:

--host www.mydomain.com

example2:

--host 215.37.25.15

port         port number, default 21

syntax:

--port port

example:

--port 21

username     FTP login username

syntax:

--username yourUsername

example:

--username david

password     FTP login password

syntax:

--password yourPassword

example:

--password myPassword

remote       specify the remote folder for FTP transfer

syntax:

--remote folder

example:

--remote "/home/david/public_html/"

local        specify the local folder for FTP transfer

syntax:

--local folder

example:

--local "D:\My Documents\"

passive      use Passive or Active FTP

syntax:

--passive <true or false>

Use Passive FTP(default):

--passive true

Use Active FTP:

--passive false

overwrite    overwrite an exisiting file?

syntax:

--overwrite false or true

replaces destination regardless of its size(default):

--overwrite true

replaces destination when size different:

--overwrite false

image        specified the Image(default) or ASCII transfer type

syntax:

--image <true or false>

Image(Binary) transfer type(default):

--image true

ASCII(Text) transfer type:

--image false

name         specify a name

syntax:

--name name

example1:

--name "my pic.jpg"

example2:

--name myPic.jpg

src          specify source name

syntax:

--src source

dst          specify destination name

syntax:

--dst destination

justprint    print all matched files, but not actually transfer them

syntax:

--justprint <false or true>

example:

--justprint true

keepalive    maintain an active connection(default 30 seconds)

syntax:

--keepalive <interval seconds to sending a command>

disable keep alive:

--keepalive -1

every 40 seconds to sending a command to server to maintain an active connection:

--keepalive 40

debug        how much information they should display?

syntax:

--debug [0,1,2,3]

disable debug information:

--debug 0

displays help information:

--debug 1

displays all responses received from the server:

--debug 2

displays all commands sent to the server:

--debug 3

encoding    choose the encoding of ftp server

syntax:

--encoding <codepage>

the ansi code page(default):

--encoding 0

UTF-8 translation(auto detected):

--encoding 65001

Russian:

--encoding 1251

Japanese:

--encoding 932

Simplified Chinese:

--encoding 936

http://msdn.microsoft.com/en-us/goglobal/bb964653.aspx


windows command line ftp examples

Connecting

To connect, first run windows command line ftp to open a command prompt . At the prompt type connect --host ftp.mysite.com --port 21 When connected, type login --username yourusername --password yourpassword, be sure enter the username and password according to which lockers your wish to access. When loggedin, you are ready to transfer files!


Changing directories

By default any downloaded files will be put in the directory you started ftp from. To change directories prior to running ftp, type cwd --name directoryname at the prompt. To change directories on your local system after running ftp, type set --local directoryname at the CmdFtp> prompt.

You may also wish to change directories on the server, to download files in a subfolder or to upload files to the incoming folder. To do so simply type cwd --name directoryname at the CmdFtp> prompt.


Downloading files

The get command is the key to downloading files. If you know the name of the file to download, simply type get --src filename and the file will be placed on your local hard-drive. If unsure of the file name, type list to get a listing of available files.

connect --host ftp.gamerz.net --port 21 
login --username anonymous --password anonymous@anonymous       
cwd --name pub  
get --src aps.tar --local "D:\testdownload" --image false

command line ftp download


Uploading files

The complement to get is the put command. If you know the name of the file you want to upload, simply type put --src filename and the file will be placed on the ftp server. To put the file on the server as a different name, type put --src filename --dst newname.

Read commands from text file

first, create a text file contains commands and save to the software install folder, each line is identified by a line feed or carriage return and line feed combination.

Lines that start with ‘#’ or that are completely blank are comments.

  1. run command from CmdFtp> prompt(By double click on CmdFtp.exe):

     CmdFtp> @cmdfile.txt
    
    or full path:
    CmdFtp> "@D:\my path\cmdfile.txt"
    
  2. call from any software:

     C:\SoftwareDownload\WindowsCmdFtp\CmdFtp.exe "@D:\my path\cmdfile.txt"
    

commands text file

read ftp commands from text file


Sinppets

Please Note: Parameters that include spaces must be enclosed in quotes

your can save the commands bellow to connect.txt in software install folder.

connect --host ftp.mydomain.com --port 21  --local "D:\testdownload"
login --username myname --password mypass --justprint false     
cwd --name dirname  

download one file:

@connect.txt
get --src myfile.txt --dst newfile.txt --image false

remove an empty directory

#be sure recurse false
rmd --name dirname --recurse false

Download It ( for Windows 10, Win 8, Win 7, Vista, XP )


comments powered by Disqus

Free command line ftp client can upload or download files, create and delete directories, rename files directly from Windows command prompt

Your can call it from any software….
Read More about Windows Command Line Ftp >>

SCREENSHOT:

 screenshot