Windows Batch Script: download file using bitsadmin without ssl certification validation

  • For the web server that does not support content range requests. You have to set priority to FOREGROUND to force the job to run synchronously. Otherwise, error: BG_E_INSUFFICIENT_RANGE_SUPPORT (0x80200013)
    bitsadmin /transfer MyJob /priority FOREGROUND  "" "C:\test\"
  • For the web server with self signed certificate or could not pass the ssl certificate validation, you cannot use a single bitsadmin /transfer command and the job has to be run asynchronously. You have to bitsadmin /create a job and bitsadmin /SetSecurityFlags to value 30
    bitsadmin /create MyJob1
    bitsadmin /addfile MyJob1 "" "C:\test\"
    bitsadmin /SetSecurityFlags MyJob1 30
    bitsadmin /SetPriority MyJob1 FOREGROUND
    bitsadmin /resume MyJob1
    bitsadmin /monitor || bitsadmin /cancel MyJob1

see also

No comments:

Post a Comment