-3

I have a text file with links to jpeg files, one link on a row.

I have Windows 10, I can install helper tools if needed.

What's the easiest way to download all those files ?

1 Answer 1

1

As with any script, it can always be improved for resiliency, but at a minimum, the following 3 lines of PowerShell should get you going:

foreach($line in Get-Content .\links.txt) { 
  Invoke-WebRequest -Uri $line -OutFile $(Split-Path -Path $line -Leaf) 
}

It makes the following assumptions:

  1. The file links.txt contains one URI per line.
  2. links.txt is in the same directory as the script.
  3. All lines in links.txt have a URI.
  4. All URIs in links.txt have a unique filename.
  5. The file are created in the same directory the script is run from.

Not the answer you're looking for? Browse other questions tagged .