Code: Select all
certutil.exe -urlcache -split -f "https://download.sysinternals.com/files/PSTools.zip" pstools.zip
Moderator: DosItHelp
Code: Select all
certutil.exe -urlcache -split -f "https://download.sysinternals.com/files/PSTools.zip" pstools.zip
Code: Select all
C:\Users\Squashman\Desktop>certutil -urlcache -?
Usage:
CertUtil [Options] -URLCache [URL | CRL | * [delete]]
Display or delete URL cache entries
URL -- cached URL
CRL -- operate on all cached CRL URLs only
* -- operate on all cached URLs
delete -- delete relevant URLs from the current user's local cache
Use -f to force fetching a specific URL and updating the cache.
Options:
-f -- Force overwrite
-gmt -- Display times as GMT
-seconds -- Display times with seconds and milliseconds
-split -- Split embedded ASN.1 elements, and save to files
-v -- Verbose operation
-privatekey -- Display password and private key data
CertUtil -? -- Display a verb list (command list)
CertUtil -URLCache -? -- Display help text for the "URLCache" verb
CertUtil -v -? -- Display all help text for all verbs
Code: Select all
certutil.exe -v -urlcache -split "https://download.sysinternals.com/files/PSTools.zip"
Just delete the urlcache after downloading (shouldn't cause any issues if and only if the same process that created the cache, deletes that cache, which here is the case):
Code: Select all
@echo off
setlocal enableExtensions disableDelayedExpansion
set "url=https://download.sysinternals.com/files/PSTools.zip"
call :download "url"
goto :eof
:download
:: %~1 name of the environment variable that holds the url
setlocal enableDelayedExpansion
:: downloading file
certutil.exe -urlcache -split -f "!%~1!" pstools.zip
::deleting cache
certutil -urlcache "!%~1!" delete
:: check referenced urlcache is deleted
certutil.exe -v -urlcache -split "!%~1!"
endlocal
goto :eof