0

I have made a batch file that can do multiple things therefor I would like it to also be able to download the file at: https://tlauncher.org/download/7495

The file name changes with each update therefore I want it to be dynamic and download without me having to change the file name each time (the Web address above never changes)

I have a bit of a habit for over complicating things and the only way I can think of doing it is by running a power shell command inside of the batch file to get the file headers then saving it to a text file and using findstr to find the name of the zip file and running curl again to download the file but this is really long winded and I'm not 100% sure how to do it if anyone knows a better way or can help me it would be much appreciated :)

(please stop marking this as a duplicate as it is not)

Lucas
  • 598
  • 9
  • 18
  • A simple command that follows all redirects should do the job – Marged Sep 06 '19 at 19:42
  • 1
    Please edit the question and put the command you are trying to make work into the question. This is how SO works. https://stackoverflow.com/help Note that on PowerShell, `curl` is an alias for `Invoke-WebRequest`. – lit Sep 06 '19 at 20:03
  • Marged ik that but I'm here because I can't figure out how to make curl redirect – Lucas Sep 08 '19 at 23:39
  • 1
    Yeahh ik that curl is an alias for invoke-werequest in powershell I'm just confused as to how I could get it to download without the filename as if u try just using curl it simply doesn't work properly – Lucas Sep 08 '19 at 23:41

1 Answers1

3

Is it what you mean?

https://curl.haxx.se/docs/manpage.html#-L https://curl.haxx.se/docs/manpage.html#-o

curl -L -o download.zip https://tlauncher.org/download/7495
idem
  • 91
  • 2
  • Thank u that works perfectly as far as I can tell i must have missed it when reading the docs before – Lucas Sep 08 '19 at 23:50
  • Via Powershell v5.1: "A parameter cannot be found that matches parameter name 'L'" – alttag Jul 31 '23 at 15:34