aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-06-12 06:39:31 +0700
committerSergey M․ <dstftw@gmail.com>2016-06-12 06:39:31 +0700
commita936ac321c5c0cee8e9769334945e744cdc60ae2 (patch)
tree9b87fd70aeb91e438aaac85bf24fade99b941fca
parent98960c911c9bacc0c366dd11b194963a82606850 (diff)
[README.md] Document using output template in batch files (Closes #9717)
-rw-r--r--README.md4
1 files changed, 4 insertions, 0 deletions
diff --git a/README.md b/README.md
index 3ff33c156..43e5114ea 100644
--- a/README.md
+++ b/README.md
@@ -553,6 +553,10 @@ The current default template is `%(title)s-%(id)s.%(ext)s`.
In some cases, you don't want special characters such as 中, spaces, or &, such as when transferring the downloaded filename to a Windows system or the filename through an 8bit-unsafe channel. In these cases, add the `--restrict-filenames` flag to get a shorter title:
+#### Output template and Windows batch files
+
+If you are using output template inside a Windows batch file then you must escape plain percent characters (`%`) by doubling, so that `-o "%(title)s-%(id)s.%(ext)s"` should become `-o "%%(title)s-%%(id)s.%%(ext)s"`. However you should not touch `%`'s that are not plain characters, e.g. environment variables for expansion should stay intact: `-o "C:\%HOMEPATH%\Desktop\%%(title)s.%%(ext)s"`.
+
#### Output template examples
Note on Windows you may need to use double quotes instead of single.