Downloading file from URL using start chrome

前端 未结 1 1669
梦谈多话
梦谈多话 2021-01-17 01:43

I have a batch file that opens a URL to download a csv file, then I need to move and then rename that csv form downloads folder to other one.

What I have is:

相关标签:
1条回答
  • 2021-01-17 02:19

    Based on my comment, you can give a try for this example to download a file with Certuil command

    @echo off
    Title Downloading a file using Certutil Command
    Mode 70,5 & color 0A
    SET CCDIR=%userprofile%\Desktop
    SET LOADDIR=%userprofile%\Downloads
    set "url=https://download.sysinternals.com/files/PSTools.zip"
    echo(
    ECHO   ******************************************************************
    ECHO          Please wait a while ... Downloading the file ...
    ECHO   ******************************************************************
    Call :download %url% %LOADDIR%
    Rem Moving the downloaded file from the folder Downloads to Desktop
    move /Y "%file%" "%CCDIR%\">nul
    Rem Open the desktop folder with explorer
    Explorer "%CCDIR%\"
    goto :eof
    ::--------------------------------------------
    :Download <Url> <File>
    Set url="%~1"
    Set file=%2\%~nx1
    certutil.exe -urlcache -split -f %url% %file%>nul
    Rem Deleting cache
    certutil -urlcache "%~1" delete>nul
    Rem Check referenced urlcache is deleted
    certutil.exe -v -urlcache -split "%~1">nul
    exit /b
    ::--------------------------------------------
    
    0 讨论(0)
提交回复
热议问题