Friday, October 4, 2024

Downloading With Curl

Open CMD in directory into which you want to download the file.
    Shift + Right Click option "open Powershell window here"
    Powershell will run every CMD command plus many more so either works fine.

curl -O -L https://www.carifred.com/uvk/UVKPortable.exe
-O download the file named
-L follows redirects
It sometimes I need -O -L so I just usually use them.

This is how to redirect, within the command line, into the location in which you want the download.

curl -o C:\Portable\UVK.exe https://www.carifred.com/uvk/UVKPortable.exe

One way to structure for multiple file downloads.
    After the initial curl command, list them one after the other separated by a space.
        I think this is more difficult to edit.
curl -O -L https://patchmypc.com/freeupdater/PatchMyPC.exe https://www.carifred.com/uvk/UVKPortable.exe
    I prefer them in a vertical list with curl commands for each item.

Wget is great also. Maybe faster for some reason.
    It requires installing wget, wereas Curl is part of Win 10 and beyond.
        There is Wget2 but the added 2 in the command irritates me :)
            or find the wget.exe file somewhere and paste it into windows\system32
            Again, a continuous list separated by a single space.
    Just download the exe and place in C:\Windows\System32
    curl -o C:\Windows\System32\wget.exe https://eternallybored.org/misc/wget/1.21.4/64/wget.exe
or
    download and send to the directory
    curl https://eternallybored.org/misc/wget/1.21.4/64/wget.exe -o "C:\Windows\System32\wget.exe"
or
winget install JernejSimoncic.Wget
Open CMD in folder desired for downloads

wget --no-check-certificate  https://patchmypc.com/freeupdater/PatchMyPC.exe https://www.carifred.com/uvk/UVKPortable.exe https://www.sordum.org/files/download/defender-exclusion-tool/ExcTool.zip

or

create a text file containing a vertical list of all the urls and name the file "some_name.txt"
    then open cmd and cd to the folder containing the txt file
        wget -i some_name.txt
better yet
        wget --no-check-certificate -i some_name.txt

If wget does not work, just find the wget.exe file somewhere and copy it to the Windows\System32 folder.
fix certificate errors with wget --no-check-certificate http://example.com

Curl, Wget, Winget & Powershell Install or Download Commands

After the mess I made in previous posts this summary might be useful.     Thanks PatchMyPC, the great and powerful program downloader and up...