Search code examples
batch-filemicrosoft-bits

Windows Bitsadmin Alternative


because Bitsadmin is getting deprecated I would like to hear if you know about an alternative to Download files from within a batch script. Best would be an alternative that already comes with windows so I don't need to download extra stuff.


Solution

  • Bacon Bits and I had the same idea at the same time. Here's an example using PowerShell's BitsTransfer module. Save this as a .bat file and run it.

    @echo off
    setlocal
    
    set "URL=http://cdn.sstatic.net/stackoverflow/img/sprites.svg"
    set "SaveAs=sprites.svg"
    powershell "Import-Module BitsTransfer; Start-BitsTransfer '%URL%' '%SaveAs%'"