# Install `wget` on Windows
## Introduction
GNU Wget (AKA `wget`) is a free software package for retrieving files using [HTTP](https://en.wikipedia.org/wiki/HTTP), [HTTPS](https://en.wikipedia.org/wiki/HTTPS), [FTP](https://en.wikipedia.org/wiki/File_Transfer_Protocol) and [FTPS](https://en.wikipedia.org/wiki/FTPS), the most widely used [Internet protocols](https://en.wikipedia.org/wiki/Internet_protocol_suite). It is a non-interactive [commandline](https://en.wikipedia.org/wiki/Command-line_interface) tool, so it may easily be called from [scripts](https://en.wikipedia.org/wiki/Scripting_language), [cron jobs](https://en.wikipedia.org/wiki/Cron), [terminals](https://en.wikipedia.org/wiki/Terminal_emulator) without [X-Windows](https://en.wikipedia.org/wiki/X_Window_System) support, etc.[^1]
While `wget` is most commonly utilized via [Unix](https://en.wikipedia.org/wiki/Unix) and [Linux](https://en.wikipedia.org/wiki/Linux) systems, it is possible to install `wget` with similar functionality on [Microsoft Windows](https://en.wikipedia.org/wiki/Microsoft_Windows) with a little bit of configuration. After an easy install, a [patch](https://en.wikipedia.org/wiki/Patch_(computing)) is necessary since the native [Win32](https://en.wikipedia.org/wiki/Windows_API#Major_versions) port from [GNU](https://gnu.org/) was last updated in 2010! 😱
Follow all [[#steps]] below, in order, and you'll have a fully functional `wget` commandline tool on your Windows machine in no time.
### Prerequisites
- [ ] Microsoft Windows
- [ ] Administrative access
- [ ] Internet connection
- [ ] Web browser
---
## Steps
1. **Install `sed` for Windows**
1. Download the latest `sed-4.2.1-setup.exe` file from the official GNU repository via: [https://sourceforge.net/projects/gnuwin32/files/sed/4.2.1/sed-4.2.1-setup.exe/download](https://sourceforge.net/projects/gnuwin32/files/sed/4.2.1/sed-4.2.1-setup.exe/download)
2. Install the downloaded `sed-4.2.1-setup.exe` setup file, accepting all default options.
2. **Patch `wget`**
1. Download the latest patched `wget.exe` x64 Windows binary of GNU Wget from [EternallyBored](https://eternallybored.org) via: [https://eternallybored.org/misc/wget/1.21.4/64/wget.exe](https://eternallybored.org/misc/wget/1.21.4/64/wget.exe)
2. Move the downloaded `wget.exe` patch file to the following filepath:
```txt
C:\Program Files (x86)\GnuWin32\bin
```
3. **Update environment variables**
1. Open the system environment variable editor via: `⊞ Win` → `Edit the system environment variables`
1. ![[edit-the-system-environment-variables.webp]]
2. Click the `Environment Variables...` button in the System Properties window
1. ![[system-properties-environment-variables.webp]]
3. Select: `User variables for...` → `Path` → `Edit...`
1. ![[edit-user-path.webp]]
4. Click the `New` button, paste the following filepath for the Windows `wget.exe` binary patch file:
```txt
C:\Program Files (x86)\GnuWin32\bin
```
1. ![[edit-environment-variable.webp]]
5. Save all changes and exit by clicking the `OK` button in each menu.
> [!done] Verify Successful Install & Configuration
> 1. Open the [Command Prompt](https://en.wikipedia.org/wiki/Cmd.exe) application via: `⊞ Win` → `Command Prompt`
> 2. Paste the following command to verify `wget` works as expected:
>
> ```txt
> wget --version
> ```
>
> ![[wget-version.webp|center]]
---
# Conclusion
In conclusion, you should now have successfully ported the `wget` functionality from Unix / Linux to Microsoft Windows, with a little external help. A big thank you to both [GNU](https://gnu.org/) and [EternallyBored](https://eternallybored.org) for creating the free software to make this possible.
> [!note]
> *Comments, corrections, and/or suggestions?* [[Contact]] me and I'll happily accredit your contribution.
[^1]: https://www.gnu.org/software/wget/