How to Download Windows ISO from Microsoft Using Wget or Curl

curlhttphttpswget

Objective: download the official Win10_1909 iso into linux directly via command line

Source: https://www.microsoft.com/en-in/software-download/windows10ISO

After selecting edition and language you get 64bit links like as follows, valid for 24 hours

https://software-download.microsoft.com/pr/Win10_1909_English_x64.iso?t=77395428-650e-4e5c-8bcc-97abca347eaa&e=1583937294&h=2b05fad63d3a6e2a0c4a20cb49f34e7c

This works fine via any gui browser or any platforms, but we need this in a linux box

  • linux server is ofcourse gui less (no intend to install gui)
  • wget/curl results in an forbidden html file download
  • Changing user agent to firefox in wget/curl or adding custom payload as curl -d '{"t": 77e897e2-a32c-419c-8f18-54770dbb5a15,"e": 1583942596,"h": 595f691df8f7e4088d24b6cc37077d1a}' and requesting the .iso file returns a forbidden page
  • tried linux based download managers like aria and axel it fails as well, forbidden

How to accomplish this via command line only?

Best Answer

I finally found a solution, and there's no extension necessary in Firefox.

After getting the URL you received, open a new tab in Firefox and open the Developer Tools (F12). Switch to the Network tab and enter the URL for the download. Hit cancel when it prompts you to download.

There will be a GET request now under Network; right-click it and select Copy > Copy as cURL. Paste this massive string into your terminal and add -o [/path/filename] to actually save the file somewhere instead of dumping it to STDOUT. That's it!


In a Chromium based browser, On the Microsoft Download page after it has created the "32-bit Download" and "64-bit Download button". Open the Developer Tools, then switch to the Network tab (it should be empty). click the 32 or 64 bit download button. It should bring up a save as dialog, cancel it. Right mouse click on the new url listed in the Network tab, Copy -> Copy as Curl Then paste it into the terminal windows, and append the -o [/path/filename] value. (ex -o Win10_20H2_v2_English.iso) and it should start downloading.

Related Question