New
#1
System.Net.WebClient in .bat problem with download zip file Powershell
Hello, I'm preparing a .bat file that downloads few files. I encountered a problem with downloading a larger file. Perhaps it is not the size of the file but a specific link. Well, in the bat file I use the command:
The file has been successfully downloaded but unfortunately has the extension (zip) (.zip) and instead of the content there is a file with the same name but no extension. After unpacking the second file, the content is finally there. But why?Code:powershell.exe -Command "(New-Object System.Net.WebClient).DownloadFile('http://download.gigabyte.eu/FileList/Driver/mb_driver_audio_realtek_9series.zip','c:\AutoInstalator_temp\mb_driver_audio_realtek_9series')"
With smaller files of this type, I did not have any problems and I used the same formula.
I also tried Start-BitsTransfer and it's the same problem. The only command that works correctly is Invoke-WebRequest but it is very slow.
Do you know how to solve my problem?