Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
FREEDOM251

Freedom251 › Blog › Command Prompt

How to Access an FTP Server from the Windows Command Prompt

By Freedom251 Team · · 9 min read

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To access an FTP server from Windows, open Command Prompt and run ftp ftp.example.com. Enter the account credentials, use dir and cd to navigate the remote server, choose binary for non-text files, then transfer data with get, mget, put, or mput. Exit with bye. This built-in client works for straightforward, trusted FTP connections, but Windows ftp.exe does not encrypt traffic and cannot use passive FTP, so it often fails on modern firewalled or NAT networks.

What Windows ftp.exe does—and when to use it

ftp.exe is the command-line client included with Windows 10, Windows 11, and current Windows Server releases. It transfers files to and from a server running the File Transfer Protocol service. You can use it interactively, one command at a time, or run a repeatable command file with the -s option.

As an Amazon Associate I earn from qualifying purchases.

The client is suitable when all of the following are true:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • The server really offers plain FTP rather than SFTP or FTPS.
  • The files and credentials are allowed to travel without encryption.
  • The network permits FTP’s control and data connections.
  • You need a simple session or a basic scheduled script rather than advanced retry, resume, or credential-management features.

Do not treat a successful login as proof that transfers will work. FTP separates control traffic from the data connection used for directory listings and file contents, so a firewall can allow authentication while blocking every listing or transfer.

#1 Best Overall
Sale
UGREEN NAS DH2300 2-Bay for Beginners & Personal Users, Phone Backup | AI Album, Private Cloud/Remote Access, File Sharing, Multi-Device Backup, Home Entertainment, 4GB RAM on Board (Diskless)
  • Entry-level NAS Personal Storage:UGREEN NAS DH2300 is your first and best NAS made easy. It is designed for beginners who want a simple, private way to store videos, photos and personal files, which is intuitive for users moving from cloud storage or external drives and move away from scattered date across devices. This entry-level NAS 2-bay perfect for personal entertainment, photo storage, and easy data backup (doesn't support Docker or virtual machines).
  • Set Your Devices Free, Expand Your Digital World: This unified storage hub supports massive capacity up to 64TB.*Storage drives not included. Stop Deleting, Start Storing. You can store 22 million 3MB images, or 2 million 30MB songs, or 43K 1.5GB movies or 67 million 1MB documents! UGREEN NAS is a better way to free up storage across all your devices such as phones, computers, tablets and also does automatic backups across devices regardless of the operating system—Window, iOS, Android or macOS.
  • The Smarter Long-term Way to Store: Unlike cloud storage with recurring monthly fees, a UGREEN NAS enclosure requires only a one-time purchase for long-term use. For example, you only need to pay $459.98 for a NAS, while for cloud storage, you need to pay $719.88 per year, $2,159.64 for 3 years, $3,599.40 for 5 years. You will save $6,738.82 over 10 years with UGREEN NAS! *NAS cost based on DH2300 + 12TB HDD; cloud cost based on 12TB plan (e.g. $59.99/month).
  • Blazing Speed, Minimal Power: Equipped with a high-performance processor, 1GbE port, and 4GB RAM on Board, this NAS handles multiple tasks with ease. File transfers reach up to 125MB/s—a 1GB file takes only 8 seconds. Don't let slow clouds hold you back; they often need over 100 seconds for the same task. The difference is clear.
  • Let AI Better Organize Your Memories: UGREEN NAS uses AI to tag faces, locations, texts, and objects—so you can effortlessly find any photo by searching for who or what's in it in seconds. It also automatically finds and deletes similar or duplicate photo, backs up live photos and allows you to share them with your friends or family with just one tap. Everything stays effortlessly organized, powered by intelligent tagging and recognition.

Connect from Command Prompt

Start a session with a host name

  1. Open Command Prompt. Press the Windows key, type Command Prompt, and open it. Use an account with access to the local folders involved in the transfer.
  2. Connect directly by entering ftp ftp.example.com, replacing the host name with the server’s DNS name or IP address.
  3. At the User prompt, type the FTP username and press Enter.
  4. Type the password when prompted. Windows does not display password characters while you type.
  5. Wait for the server’s confirmation. A prompt such as ftp> indicates that the client is ready for FTP commands.

Open a server after starting ftp.exe

You can also start the client without a host and connect later:

  1. Run ftp.
  2. At the ftp> prompt, enter open ftp.example.com.
  3. Provide the username and password when requested.

This second form is useful if you need to change servers during one command-line session. The server must permit the account you use; anonymous access works only when the administrator has enabled it. Never assume that entering anonymous will succeed or that an anonymous account has permission to upload.

Choose local and remote folders

FTP maintains two working locations: the remote directory on the server and the local directory on your Windows computer. Set both before transferring so that a short file name refers to the intended locations.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Command What it changes or displays Example
dir Lists files and folders in the current remote directory. dir
cd folder Changes the remote working directory. cd /backups
pwd Shows the current remote path. pwd
lcd path Changes the local Windows working directory. lcd C:Backups
! command Runs a local Command Prompt command without ending the FTP session. ! dir

Use pwd and dir to verify the server location, then use lcd to select a local folder that already exists. If a path contains spaces, enclose it in quotation marks, for example lcd "C:UsersAlexMy Files". The local directory is independent of the directory shown by a normal Command Prompt before you started ftp.exe.

Set the correct transfer type

Run binary before moving anything that is not plain text. Binary mode preserves every byte and is required for ZIP archives, images, PDFs, executables, database files, disk images, and most backups.

Rank #2
Sale
UGREEN NAS DXP2800 2-Bay for Advanced Home Users, Remote Workers & Creators | Home Media & Data Center, Docker & VM, Plex, Fast File Transfer, Intel N100, 8GB DDR5, 2.5GbE, 2x M.2 NVMe, 4K HDMI(Diskless)
  • 【Advanced Home Data & Media Hub】For advanced home users who need phone backup, file storage, and centralized data management. Centralize family photos, 4K videos, movies, computer backups, and personal files in one place while running multiple apps for home entertainment and everyday data management. Suitable for households with growing digital libraries and multiple NAS use cases.
  • 【Built for Creators, Media Servers & Advanced Apps】Powered by the Intel N100 Quad-Core CPU, 8GB DDR5 RAM, 2.5GbE networking, and dual M.2 NVMe slots, DXP2800 handles large files and heavier workloads with ease. Run Docker, virtual machines, and media server applications compatible with Plex—ideal for content creators, tech enthusiasts, and advanced home users managing 4K videos, RAW photos, personal media libraries, and multiple NAS apps.
  • 【Up to 80TB for Growing Digital Libraries】 Supports up to 80TB of storage using two HDD bays and two M.2 NVMe SSD slots for family photos, movies, RAW photos, 4K videos, work files, and device backups. AI photo management supports recognition of people, objects, scenes, and locations, album organization, and duplicate photo detection. HDDs and SSDs are not included.
  • 【AI-powered Home Surveillance】Turn DXP2800 into a centralized home surveillance hub by connecting compatible network cameras and storing recordings locally on your NAS. AI-powered features include Face Recognition, People Detection, and Pet Detection, helping advanced home users review important events more efficiently while managing home surveillance and personal data in one place.
  • 【One data Center Across Your Devices】Keep files from desktops, laptops, phones, tablets, and other devices together instead of scattered across cloud accounts and external drives. Access, back up, organize, and share data across Windows, macOS, Android, iOS, web browsers, and compatible smart TVs—ideal for creators and advanced home users working across multiple devices.

ASCII mode performs line-ending conversion intended for text files. That conversion can damage a binary file even when the transfer reports success. If you intentionally transfer a text file and need text conversion, use ascii; otherwise, make binary part of every session and script. Set the mode before the first get, put, mget, or mput.

Download files from the server

Download one file

After selecting the remote directory and local folder, run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
binary
get site-backup.zip

get copies one remote file to the local directory. To give the local copy a different name, provide a second name when prompted by the client, or use the command’s local-name form where supported by the server and client. Confirm the resulting file locally before deleting or replacing the server copy.

Download several files

Use a wildcard pattern with mget:

binary
mget *.zip

By default, the client asks you to confirm each matching file. Enter prompt once to turn those per-file questions off, then run the multi-file command:

prompt
mget *.zip

Run prompt again to restore confirmations. Patterns are evaluated by the FTP server, so the files matched depend on that server’s implementation and current directory.

Rank #3
Sale
UGREEN NAS DH4300 Plus 4-Bay for Beginners, Home Users & Remote Workers | Photo & Video Backup, AI Photo Album, File Hub, Private Cloud & Secure Home Surveillance, 8GB LPDDR4X, 4K HDMI (Diskless)
  • Entry-level NAS Home Storage: The UGREEN NAS DH4300 Plus is an entry-level 4-bay NAS that's ideal for home media and vast private storage you can access from anywhere and also supports Docker but not virtual machines. You can record, store, share happy moment with your families and friends, which is intuitive for users moving from cloud storage, or external drives to create your own private cloud, access files from any device.
  • Smart Photo Backup & AI Album: Automatically back up photos and videos from your phone in real time and keep growing family memories organized with AI-powered photo albums. Semantic search, custom learning, and recognition of people, objects, pets, and similar photos help you quickly find the moments you want. Duplicate photo removal also helps keep your library organized—ideal for families and users with large photo collections.
  • User-Friendly App & Easy Setup: Connect quickly via NFC, set up simply and share files fast on Windows, macOS, Android, iOS, web browsers, and smart TVs. You can access data remotely from any of your mixed devices. What's more, UGREEN NAS enclosure comes with beginner-friendly user manual and video instructions to ensure you can easily take full advantage of its features.
  • More Cost-effective Storage Solution: Unlike cloud storage with recurring monthly fees, A UGREEN NAS enclosure requires only a one-time purchase for long-term use. For example, you only need to pay $629.99 for a NAS, while for cloud storage, you need to pay $719.88 per year, $1,439.76 for 2 years, $2,159.64 for 3 years, $7,198.80 for 10 years. You will save $6,568.81 over 10 years with UGREEN NAS! *NAS cost based on DH4300 Plus + 12TB HDD; cloud cost based on 12TB plan (e.g. $59.99/month).
  • Your Data, You Control:No third-party clouds, no hidden access, UGREEN NAS provides a more secure and private data storage solution. It stores data locally on your private hard drives and does automatic backups. Thus, you can keep full control over it. The advanced encryption is TRUSTe certified in the United States and is awarded the first (and only) ETSI EN 303 645 certification mark for NAS products by TÜV SÜD Group.

Upload files to the server

Upload one file

Set the local directory with lcd, change to the desired remote directory with cd, select binary mode, and run:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
lcd C:Backups
cd /incoming
binary
put site-backup.zip

The account must have write permission in the remote directory. Many servers allow downloads but deliberately reject uploads, so a 550-style permission response is a server policy issue rather than a Windows syntax error.

Upload multiple files

Use mput with a pattern:

prompt
mput *.zip

With prompting disabled, every matching local file is sent without an individual confirmation. Check the local pattern carefully first; a broad pattern such as *.* can upload more data than intended.

End the session safely

Use bye or quit to close the FTP connection and return to the normal Command Prompt. Closing the window also ends the process, but the explicit command lets the server receive a clean logout and makes scripts easier to audit.

Automate a repeatable transfer

Microsoft documents the -s:filename option for executing FTP commands from a text file. Create a file such as commands.txt with one FTP command per line:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
BUFFALO LinkStation 210 2TB 1-Bay NAS Network Attached Storage with HDD Hard Drives Included NAS Storage that Works as Home Cloud or Network Storage Device for Home
  • Value NAS with RAID for centralized storage and backup for all your devices. Check out the LS 700 for enhanced features, cloud capabilities, macOS 26, and up to 7x faster performance than the LS 200.
  • Connect the LinkStation to your router and enjoy shared network storage for your devices. The NAS is compatible with Windows and macOS*, and Buffalo's US-based support is on-hand 24/7 for installation walkthroughs. *Only for macOS 15 (Sequoia) and earlier. For macOS 26, check out our LS 700 series.
  • Subscription-Free Personal Cloud – Store, back up, and manage all your videos, music, and photos and access them anytime without paying any monthly fees.
  • Storage Purpose-Built for Data Security – A NAS designed to keep your data safe, the LS200 features a closed system to reduce vulnerabilities from 3rd party apps and SSL encryption for secure file transfers.
  • Back Up Multiple Computers & Devices – NAS Navigator management utility and PC backup software included. NAS Navigator 2 for macOS 15 and earlier. You can set up automated backups of data on your computers.
binary
cd /backups
lcd C:Backups
get site-backup.zip
bye

Run it from Command Prompt with:

ftp -s:commands.txt ftp.example.com
  1. Save the command file in a folder you can protect from other users.
  2. Use a least-privilege FTP account that can access only the required directories.
  3. Test the commands interactively before scheduling them.
  4. Run the script from the directory containing the file, or provide a full path such as ftp -s:C:Scriptscommands.txt ftp.example.com.
  5. Review the command output and verify the downloaded or uploaded file after each run.

On Windows 8 and Windows Server 2012 or later, the command file must be UTF-8. Save it as UTF-8 rather than a legacy code page when it contains non-ASCII characters or when you want to meet the documented encoding requirement.

Protect credentials in scripts

A script can include login and transfer commands, but putting a username and password in a shared text file creates a credential risk. Anyone who can read the file may be able to use the account, and ordinary FTP sends those credentials across the network without encryption. Keep credentials out of shared scripts where possible, restrict file permissions, avoid storing scripts in public folders, and use an account limited to the exact operation required. For sensitive or unattended jobs, use a separately installed client that supports encrypted authentication and a safer credential store.

FTP commands worth knowing

Command Use Typical example
open host Connects to a server from an existing FTP prompt. open ftp.example.com
user Supplies or changes the login identity. user backupuser
dir Requests a detailed remote listing. dir
ls Requests a shorter remote listing when supported. ls
cd Moves to a remote directory. cd /daily
cdup Moves to the remote parent directory. cdup
pwd Displays the remote working path. pwd
lcd Changes the local Windows path. lcd C:Downloads
binary Uses byte-for-byte binary transfer. binary
ascii Uses text transfer with line-ending conversion. ascii
get Downloads one remote file. get report.pdf
mget Downloads files matching a pattern. mget *.csv
put Uploads one local file. put report.pdf
mput Uploads local files matching a pattern. mput *.csv
prompt Toggles confirmation for multi-file commands. prompt
status Shows the current FTP client settings and connection state. status
bye or quit Closes the session. bye
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Why login works but dir or get hangs

FTP uses two connections

The control channel normally uses TCP port 21 for commands and authentication. Directory listings and file transfers use a separate data channel. Opening port 21 alone can therefore produce a successful login followed by a stalled dir, get, or put.

Active and passive FTP

In active mode, the server connects back to a listening port on the client for the data channel. In passive mode, the client connects outward to a server-selected data port. Passive mode is generally better for Internet users behind NAT devices and firewalls because inbound connections to the client are avoided.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Windows ftp.exe does not support passive connections. That limitation is a common cause of a login that succeeds while listings or transfers time out. If the client is behind a router, corporate firewall, or endpoint firewall, the server’s attempt to open the active data connection may be blocked.

Best Value
Synology DS225+ Private Cloud Media Server - Stream, Back Up Photos & Share Files, Intel CPU for Hardware Transcoding (2-Bay Diskless NAS)
  • Your Personal Streaming Server - Build your own Netflix-style media library and stream 4K movies, shows and photos to any device without monthly fees
  • Create Your Own Cloud - Store your entire photo, video and music collection; access from anywhere with fast 282 MB/s transfer speeds
  • Creator-Grade Backup Solution - Protect your irreplaceable content with automated backups to cloud services, external drives and remote NAS
  • Multi-Layered Data Protection - Combine RAID redundancy, automated backups and snapshot technology to prevent data loss from any cause
  • Smart Home Surveillance - Support up to 30 IP cameras with AI detection, instant alerts and secure remote monitoring

Practical fixes

  • Ask the server administrator which FTP mode and port policy the service requires.
  • Allow the required active-mode return traffic through the client firewall only when the network policy permits it.
  • On an IIS FTP server, configure a defined passive data-port range and allow that range through the server firewall when passive-capable clients are used.
  • Ensure the server-side and client-side firewall rules match the selected mode; a rule for port 21 does not automatically permit the data range.
  • Switch to a separately installed FTP client with passive-mode support when the network uses NAT or blocks active callbacks.

Do not repeatedly retry a stalled transfer without checking the data-channel design. Retries cannot solve a port-direction mismatch.

Security limits and protocol choices

Built-in ftp.exe supports plain FTP only. It has no FTPS or SFTP support, and it sends login credentials and file contents without encryption. Anyone able to observe the network path may be able to read the username, password, and transferred data.

Use a secure-capable client when the server requires:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • SFTP: file transfer over SSH, with encrypted authentication and data.
  • FTPS: FTP protected with TLS, provided the server and client agree on certificates and encryption settings.
  • Passive FTP: needed when the built-in client’s active-only behavior conflicts with NAT or firewall policy.
  • Reliable unattended jobs: advanced clients may offer retries, resume support, scheduling, logging, and protected credential storage that ftp.exe does not provide.

For a trusted legacy network and non-sensitive files, the built-in client can be adequate. For credentials, personal data, production backups, or any transfer across an untrusted network, choose an encrypted protocol instead of trying to make plain FTP safe with a stronger password.

Diagnose common errors

“Connection timed out” before login

  • Check the host name or IP address and verify that the server is listening on the expected FTP port.
  • Confirm that DNS resolves the name from the same Windows computer.
  • Ask whether a firewall, VPN, proxy, or network policy blocks outbound FTP.

Login rejected

  • Re-enter the username and password carefully; passwords are case-sensitive on many servers.
  • Confirm that the account is enabled for FTP and has not expired or been locked.
  • Do not assume anonymous access is enabled.

dir shows no listing or freezes

  • Suspect the data channel rather than the credentials.
  • Check active-mode firewall rules and NAT behavior.
  • Use a passive-capable client or have the administrator align the server’s passive port range and firewall rules.

Upload fails but download works

  • Verify write permission on the remote directory.
  • Check whether the server has a quota, filename policy, or read-only account.
  • Confirm that the local file exists in the path selected by lcd.

The downloaded archive will not open

  • Repeat the transfer with binary set before get or mget.
  • Compare the local file size with the server copy when the server provides that information.
  • Delete the damaged local copy before retrying so that an old partial file is not mistaken for a successful transfer.

Complete example session

The following sequence connects, checks the remote path, selects a local destination, downloads a backup, uploads a report, and logs out:

C:> ftp ftp.example.com
User: backupuser
Password:
ftp> pwd
ftp> dir
ftp> cd /backups
ftp> lcd C:Backups
ftp> binary
ftp> get site-backup.zip
ftp> lcd C:Reports
ftp> cd /incoming
ftp> put status-report.pdf
ftp> bye

Replace every host name, directory, and file name with values supplied by the server administrator. Verify the remote and local paths after each cd or lcd; a successful command does not mean you selected the directory you intended.

When to move beyond ftp.exe

Choose another client when encryption, passive mode, robust automation, or operational visibility matters. Compare candidates by protocol support (plain FTP, FTPS, and SFTP), passive-mode behavior, command-line and scripting quality, retry and resume functions, credential handling, scheduling, and logging. Keep ftp.exe for simple, trusted legacy sessions where its active-only and unencrypted design is an explicit, acceptable constraint.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Command PromptFile TransferFTPftp.exeNetwork TroubleshootingWindows

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.