Hello 2 examples to explain. Code: set "SetupFile=https://officecdn.microsoft.com/pr/wsus/setup.exe" call :DOWNLOAD %SetupFile% setup.exe goto :eof :DOWNLOAD powershell -Command "Start-BitsTransfer -Source '%1' -Destination '%2'" exit /b Work. Code: set "SetupFile=https://c2rsetup.officeapps.live.com/c2r/download.aspx?ProductreleaseID=ProPlusRetail&platform=x64&language=fr-fr&version=O16GA" call :DOWNLOAD %SetupFile% setup.exe goto :eof :DOWNLOAD powershell -Command "Start-BitsTransfer -Source '%1' -Destination '%2'" exit /b Does not work. Error message. On the other hand, in a Powershell window the URL works. Code: Start-BitsTransfer -Source 'https://c2rsetup.officeapps.live.com/c2r/download.aspx?ProductreleaseID=ProPlusRetail&platform=x64&language=fr-fr&version=O16GA' -Destination 'setup.exe' Also works if I use the 'curl' command. A solution ?
Code: set "SetupFile=https://c2rsetup.officeapps.live.com/c2r/download.aspx?ProductreleaseID=ProPlusRetail&platform=x64&language=fr-fr&version=O16GA" call :DOWNLOAD "%SetupFile%" setup.exe goto :eof :DOWNLOAD powershell -Command "Start-BitsTransfer -Source '%~1' -Destination '%2'" exit /b