Skip to content

Commit b135c48

Browse files
authored
Update aria2c.cmd
1 parent 6cb8d57 commit b135c48

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

CLI/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## First of all
2+
- Download the latest [aria2c](https://github.com/aria2/aria2/releases/latest)
3+
- C:\cli\aria2c.cmd
4+
- C:\cli\aria2c.conf
5+
- C:\cli\aria2c.session
6+
- C:\cli\\*\aria2c.exe
7+
- Put `aria2c.exe` in any sub-folder or the same folder as `aria2c.cmd`
8+
- Run `aria2c.cmd`
9+
- Use [switches](#switches)
10+
11+
## Switches
12+
- `/s`
13+
- Run `aria2c` without command line window
14+
- `/r`
15+
- Add `aria2c` to registry, so that `aria2c` will run at Windows startup
16+
- `/u`
17+
- Remove `aria2c` from registry, stop running `aria2c` at Windows startup

CLI/aria2c.cmd

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@echo off
2+
setlocal enabledelayedexpansion
3+
pushd %~dp0
4+
for /f "delims=" %%a in ('dir /s /b aria2c.exe') do (set aria2c=%%a)
5+
if not defined aria2c goto :eof
6+
set aria2c=!aria2c:%~dp0=!
7+
if not exist aria2c.session type nul > aria2c.session
8+
if [%1] equ [/s] goto :nowindow
9+
if [%1] equ [/r] goto :register
10+
if [%1] equ [/u] goto :Unregister
11+
"%aria2c%" --conf=aria2c.conf
12+
:register
13+
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "aria2c" /t "REG_SZ" /d "mshta vbscript:CreateObject(\"Shell.Application\").ShellExecute(\"%aria2c%\",\"--conf=aria2c.conf\",\"%~dp0",\"\",0)(window.close)" /f
14+
:nowindow
15+
mshta vbscript:CreateObject("Shell.Application").ShellExecute("bin\aria2c.exe","--conf=aria2c.conf","%~dp0","",0)(window.close)
16+
exit
17+
:unregister
18+
taskkill /im "aria2c.exe"
19+
reg delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /v "aria2c" /f

CLI/aria2c.conf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#Basic
2+
dir=${HOME}/Downloads
3+
disk-cache=512M
4+
continue=true
5+
input-file=aria2c.session
6+
save-session=aria2c.session
7+
save-session-interval=60
8+
#HTTP/FTP/SFTP
9+
max-concurrent-downloads=16
10+
max-connection-per-server=10
11+
min-split-size=1M
12+
split=10
13+
#BitTorrent
14+
##follow-torrent=false
15+
dht-file-path=dht.dat
16+
dht-file-path6=dht6.dat
17+
##enable-dht6=true
18+
#RPC
19+
enable-rpc=true
20+
rpc-allow-origin-all=true
21+
rpc-listen-all=true
22+
##rpc-secret=jc3213
23+
#Debug
24+
#console-log-level=debug

CLI/aria2c.session

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)