简体   繁体   中英

Open invisible download url (and after download, close it)

Here's my problem : Since 2016, I make some bots that we need to manually do UPDATE, and now, with some code in the .bat, the bot can do a UPDATE alone, but he open the browser and after download the file, he didn't close it.

I wanted to use ByteTransfer in Powershell or curl, but the download link like that: "https://drive.google.com/uc?export=download&id=4DJ8skd91lp" (ByteTransfer and curl need a download link like this: "http://myserver.com/file.ext" ).

What I want it's to open INVISIBLE BROWSER to download the file and close it after (only the invisible browser, for client didn't have to get f#cked by the UPDATE) .

I could use Iexplorer, but the download need a confirm, and the bot (.bat) can't detect if the download are waiting 'cus need confirm.

So, can we download a file in a url without a ".ext, .bat, .txt" in the end and without disturbing the client? Like some application that's do UPDATE ?

Thank's for answer.

Thank's to LotPings, using Powershell in cmd, this command download the file in URL without confirm and without opening the browser : powershell Invoke-WebRequest -Uri "'%URL%'" -OutFile "'%OUTPUT%'"

CMD use (") and powershell use ('). just need in the cmd to : set url=https://... set output=%systemdrive%...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM