Windows Batch: wget to download Nirsoft tools – leads to corrupt files

  aria2, batch-file, curl, wget, windows

As I made a batch file to update NirSoft tools ( I made a strange experience using wget. First I downloaded a text file with pad links:

wget --backups=20 --append-output=C:PathUpdateLOGNirsoft%Timestamp%_NirSoft.log

After I used fart ( to delete rows I do not need from the pad-links.txt file. Also I used that program to change the download links to ( and change the file extensions to ".zip". fart ".pad-links.txt" "" "" | tee --append C:PathUpdateLOGNirsoft%Timestamp%_NirSoft.log and fart ".pad-links.txt" ".xml" ".zip" | tee --append C:PathUpdateLOGNirsoft%Timestamp%_NirSoft.log

After I used wget --timestamping --input-file=C:PathUtilSuitNirLauncherDownloadpad-links.txt --append-output=C:PathUpdateLOGNirsoft%Timestamp%_NirSoft.log to download the programs. Having a look at the log file I found out that not all programs are stored in this location. Per example WirelessKeyView is stored in (

Trying to get this file with wget leads to downloaded corrupt files at size of 4kb. The same with cURL und aria2. When I download it with Mozilla or IDM I have no problems to get the file. So I tried out wget --auth-no-challenge or wget --header="Accept: text/html" --user-agent="Mozilla/5.0 ..."

I also tried cliget, the wget/aria2/curl lines it produced while normal downloading with Mozilla. wget --header 'Host:' --user-agent 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:92.0) Gecko/20100101 Firefox/92.0' --header 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' --header 'Accept-Language: de,en-US;q=0.7,en;q=0.3' --referer '' --header 'Upgrade-Insecure-Requests: 1' --header 'Sec-Fetch-Dest: document' --header 'Sec-Fetch-Mode: navigate' --header 'Sec-Fetch-Site: same-origin' --header 'Sec-Fetch-User: ?1' --header 'DNT: 1' --header 'Sec-GPC: 1' '' --output-document ''

I googled and found this reference for powershell (same error): Downloading certain files using powershell produce corrupt files but cannot reproduce the working answer in batch (I am not familiar with powershell scripting). So how is is possible to download the single file with wget/curl or aria2 in a batch script? A workaround I found out is downloading it directly from the pad Panel but I want the .zip-file including the updated .chm-file and also the 64-bit versions, if available. One more note, within my anti-virus tool the nirsoft site is exempted from scanning, so that is not the answer. Any solutions?

Source: Windows Questions