0% found this document useful (0 votes)
282 views

How To Download All Files From A Website Directory Using Wget Windows

Index files

Uploaded by

Steven Frayne
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
282 views

How To Download All Files From A Website Directory Using Wget Windows

Index files

Uploaded by

Steven Frayne
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

How to Download All Files From a

Website Directory Using Wget Windows


Published by Nyau Wai Hoe - Updated on April 14, 2021

If you want to download all les or only certain type of les (such as only images) from a website
directory or a web folder, you can use a tool called Wget in Windows to download the les
automatically. In this guide, you will learn how to use Wget (a command to be executed in command
prompt) to download les from a website directory in Windows 10.

Download All Files From a Website Directory


An example of such situation is when you need to download all les or only certain type of les such
as images, PDF, etc, from an “Index of” web directory or a website folder. Instead of having to right-
click each of them and clicking “save as”, you can download each and every le in the directory
automatically using the “Wget” command in the command prompt on Windows 10. Here’s how to do
it.
First, you need to download the Wget tool in order to be able to use it in CMD. You can download Wget
from the link below (preferably the zip version):

https://eternallybored.org/misc/wget/

Once downloaded, unzip it onto any directory you like. To make things easier later, unzip it to C:\wget.
Next, open an elevated Command Prompt (run as administrator).

To be able to run the Wget command, you need to rst change the current working directory to the
Wget folder. If you unzip the Wget to C:\wget earlier, in command prompt, type the following to
change directory to C:\wget.

cd c:\wget
While you are in the directory, enter the following command to execute the automatic downloads of all
les from the entered website directory.

wget -r -np -nH  https://www.example.com/dir1/dir2/dir3

Note: Replace the example website address with the actual website directory where you want to
download the les from. This command will download all les from the entered website directory. The
parameters are case sensitive. Below are the explanations of what each of the parameters does.

-r is to allow recursive download. If this is absent, the command will only download the rst le
on the directory.
-np is short for no parent. It tells the command not to ascend to the parent directory. Without
this parameter, the command will ascent to and download les from the parent directories such
as example.com, example.com/dir1 and example.com/dir1/dir2.
-nH is short for no hostname. It tells the command not to create host directories.

The les will be downloaded onto the same directory as where the Wget.exe is. In the example above,
new directories will be automatically created within the C:\wget folder and the les will be downloaded
onto these directories.

Other parameters you might need


-A parameter will tells the command to download only certain type of le. For example, “-A pdf” will
tell the command to only download PDF les from the website directory. If you want to download only
certain type of images, for example, jpg les from a website directory, use “-A jpg”. Below is an
example of including -A parameter in the Wget command.

wget -r -np -nH -A jpg https://www.example.com/dir1/dir2/dir3

-R parameter ignores certain le or type of le that you don’t want to download. For example, “-R
index.html” will tell the Wget command to skip the index.html le and not download it. “-R CSS” will
ignore all CSS les from the directory. Below is an example of using wget with -R parameter.
wget -r -np -nH -R index.html https://www.example.com/dir1/dir2/dir3

–cut-dirs parameter will tell the command how many directory you want to omit. For example, if you
download les from https://www.example.com/dir1/dir2/dir3 without cut-dirs (and with -nH), the
folder created on your PC will have the directory structure of dir1\dir2\dir3. If you want to ignore the
dir1\dir2 folders, you can use the –cut-dirs command to omit the directories. Here’s an example of
using wget with –cut-dirs parameter. Note that the –cut-dirs parameter has two dashes (-) in it.

wget -r -np -nH -A pdf --cut-dirs=1 https://www.example.com/dir1/dir2/dir3

Parameters are case sensitive. If you are using, for example, -A to lter download only certain type of
les, if you enter -a instead, it won’t work.

To view all other available parameters you can use with Wget, in the command prompt, type the
following command.

wget -help

You'll also like:

How to Find The IP Address of a Website in Windows 10 / 11


ERR_CONNECTION_TIMED_OUT Chrome Website in Windows 10 (Fix)
Deleted Files Keep Coming Back in Windows 10, What Should I Do?
Download Internet Explorer 11 for Windows 10 64 bit O ine Installer
How to Clear or Disable Recent Files in Windows 10 Quick Access

Description for sharing: This guide shows how to download all les or only certain type of les from a
website directory or web folder using Wget in Windows 10.

Categories: COMPUTING DOWNLOAD WINDOWS 10


Similar Articles

How to Find The IP Address of a Website in Windows 10 / 11


If for some reason you need to nd out the IP address of a website, there is a simple way to do it using
command prompt in Windows 10. This short tutorial will show you how to quickly nd the IP address of
a website using CMD in Windows 10. […]

How to Search Only Video Files in Windows 11


In File Explorer, other than just searching by keywords, you can also enter a search syntax to search for a
speci c kind of les, le type, size of les, etc. in Windows 11. This short tutorial will show you how to
search only video les or nd only a speci c […]

ERR_CONNECTION_TIMED_OUT Chrome Website in Windows 10 (Fix)


When a website fails to load due to the server taking too much time to reply your request, Chrome will
show This webpage is not available ERR_CONNECTION_TIMED_OUT or This site cannot be reached
ERR_CONNECTION_TIMED_OUT. The applicable solutions depend on whether the
ERR_CONNECTION_TIMED_OUT error shows up on only one or certain […]

Copy But Keep Both Files Option Missing in Windows 10


In previous versions of Windows, when you copy or move a le to a location where another le with an
identical name already exists, Windows will prompt you to select an action to be taken – if you want to
Replace or overwrite the le, to cancel and skip this […]

How to Install Active Directory Users and Computers in Windows 10


If you are using Windows 10 Pro or Enterprise edition, here’s how to install Active Directory Users and
Computers in Windows 10. You can also use this method to reinstall active directory users and
computers in Windows 10 if it’s missing after update. Active Directory Users and Computers is a […]
Download Internet Explorer 11 for Windows 10 64 bit Of ine Installer
Internet Explorer 11 is a pre-installed built-in browser for Windows 10. There is no need for you to
download Internet Explorer 11 for Windows 10. If you can’t nd Internet Explorer in your Windows 10
computer, here’s what you can do to re-enable it. Just so you know, Internet Explorer […]

We Recommend

How to Auto Login Windows 11 Without Password or PIN

How to Change Taskbar Color to Any Color in Windows 11

How to Move Start Menu and Taskbar Icons To The Left in Windows 11
How to Find Recently Watched Videos on Facebook

How to Set YouTube to Always Play Highest Video Quality Permanently

About

Windows Digital is an independent tech website that contains articles, tips, how-to guides, tutorials, error xes, help,
support, news and downloads about Windows 10.

All product names, logos, copyrights, and trademarks mentioned are acknowledged as the registered intellectual
property of their respective owners.

This site is not in any way a liated with, nor has it been authorized, sponsored, or otherwise approved by, Microsoft
Corporation.

Site Author

Alvin Nyau

I'm the admin and founder of Windows Digital. I've been in the software industry for over 12 years, spending most of
my time working with Windows operating system. My objective is to create a portal to help Windows users solve
their PC problems.

Recent Posts
How To Play PC Games With PS5, PS4 Or Xbox Controller On Windows 11 October 21, 2021

How To Use Wireless Controller As Mouse And Keyboard In Windows 11 October 20, 2021

How To Take Ownership Of A File, Folder Or Drive In Windows 11 October 18, 2021

How To Restrict User Access To A Folder Or Drive In Windows 11 October 16, 2021

How To Reduce Photo File Size In Windows 11 October 15, 2021

About Us Privacy Policy Terms And Policies

Copyright © 2018-2021 WindowsDigitals.com. All rights reserved.

You might also like