File: placeholders.html

package info (click to toggle)
keepass2 2.41%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 13,892 kB
  • sloc: cs: 103,600; xml: 5,869; cpp: 308; sh: 48; makefile: 46
file content (689 lines) | stat: -rw-r--r-- 31,600 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="expires" content="0" />
	<meta http-equiv="cache-control" content="no-cache" />
	<meta http-equiv="pragma" content="no-cache" />

	<meta name="author" content="Dominik Reichl" />

	
	

	<meta name="DC.title" content="Placeholders - KeePass" />
	<meta name="DC.creator" content="Dominik Reichl" />
	<meta name="DC.type" content="Text" />
	<meta name="DC.format" content="text/html" />
	<meta name="DC.language" content="en" />
	<meta name="DC.rights" content="Copyright (C) 2003-2019 Dominik Reichl" />

	<meta name="robots" content="index, follow" />
	<meta name="flattr:id" content="42rykv" />

	<title>Placeholders - KeePass</title>
	<base target="_self" />
	<link rel="stylesheet" type="text/css" href="../../default.css" />
	
</head>
<body>




<table class="sectionsummary"><tr><td width="68">
<img src="../images/b64x64_chardevice.png" width="64" height="64"
class="singleimg" align="left" alt="Placeholder Icon" />
</td><td valign="middle"><h1>Placeholders</h1><br />
KeePass supports various placeholders.
</td></tr></table>

<p>In many places in KeePass (auto-type, URL field, triggers, ...),
placeholders can be used.</p>

<ul>
<li><a href="#entryfields">Entry Field Placeholders</a></li>
<li><a href="#fieldrefs">Entry Field References</a></li>
<li><a href="#envctx">Paths and Date/Time Placeholders</a></li>
<li><a href="#envvars">Environment Variables</a></li>
<li><a href="#texttrf">Text Transformations</a></li>
<li><a href="#plh">Other Placeholders</a></li>
</ul>








Placeholders are case-insensitive.



<br />

<p>KeePass uses the abbreviation &quot;Spr&quot; for &quot;String placeholder replacement&quot;.
An <em>Spr-compiled</em> field is a field where placeholders are replaced
when performing an action with this field (like copying it to the
clipboard, sending it using auto-type, etc.).</p>

<p>References in a field to (parts of) the field itself are
unsupported. For example, the <code>{URL:HOST}</code> placeholder
cannot be used in the URL field (but it can be used in the
'Override URL' field).</p>

<br />

<a name="entryfields"></a>
<h2 class="sectiontitle"><img src="../images/b16x16_chardevice.png"
class="singleimg" alt="Placeholder" />&nbsp;&nbsp;Entry Field Placeholders</h2>

<br />

<table class="tablebox75">
<tr><th width="50%">Placeholder</th><th width="50%">Field</th></tr>
<tr><td width="50%"><code>{TITLE}</code></td><td width="50%">Title</td></tr>
<tr><td width="50%"><code>{USERNAME}</code></td><td width="50%">User name</td></tr>
<tr><td width="50%"><code>{URL}</code></td><td width="50%">URL</td></tr>
<tr><td width="50%"><code>{PASSWORD}</code></td><td width="50%">Password</td></tr>
<tr><td width="50%"><code>{NOTES}</code></td><td width="50%">Notes</td></tr>
</table>

<br />


Custom strings can be referenced using <code>{S:<i>Name</i>}</code>.
For example, if you have a custom string named &quot;eMail&quot;,
you can use the placeholder <code>{S:eMail}</code>.


<br />

<br />


<table class="tablebox75">
<tr><th width="50%">Placeholder</th><th width="50%">Is Replaced By</th></tr>
<tr><td width="50%"><code>{URL:RMVSCM}</code></td><td width="50%">Entry URL without scheme name.</td></tr>
<tr><td width="50%"><code>{URL:SCM}</code></td><td width="50%">Scheme name of the entry URL.</td></tr>
<tr><td width="50%"><code>{URL:HOST}</code></td><td width="50%">Host component of the entry URL.</td></tr>
<tr><td width="50%"><code>{URL:PORT}</code></td><td width="50%">Port number of the entry URL.</td></tr>
<tr><td width="50%"><code>{URL:PATH}</code></td><td width="50%">Path component of the entry URL.</td></tr>
<tr><td width="50%"><code>{URL:QUERY}</code></td><td width="50%">Query information of the entry URL.</td></tr>
<tr><td width="50%"><code>{URL:USERINFO}</code></td><td width="50%">User information of the entry URL.</td></tr>
<tr><td width="50%"><code>{URL:USERNAME}</code></td><td width="50%">User name of the entry URL.</td></tr>
<tr><td width="50%"><code>{URL:PASSWORD}</code></td><td width="50%">Password of the entry URL.</td></tr>
</table>
<br />
An example can be found <a href="#url">below</a>.


<br /><br />

<a name="fieldrefs"></a>
<h2 class="sectiontitle"><img src="../images/b16x16_chardevice.png"
class="singleimg" alt="Placeholder" />&nbsp;&nbsp;Entry Field References</h2>

<p>Fields of <i>other</i> entries can be inserted using
<a href="fieldrefs.html">Field References</a>.</p>

<br />

<a name="envctx"></a>
<h2 class="sectiontitle"><img src="../images/b16x16_chardevice.png"
class="singleimg" alt="Placeholder" />&nbsp;&nbsp;Paths and Date/Time Placeholders</h2>

<br />

<table class="tablebox75">
<tr><th width="50%">Placeholder</th><th width="50%">Is Replaced By</th></tr>
<tr><td width="50%"><code>{INTERNETEXPLORER}</code></td><td width="50%">Path of Internet Explorer, if installed.</td></tr>
<tr><td width="50%"><code>{FIREFOX}</code></td><td width="50%">Path of Mozilla Firefox, if installed.</td></tr>
<tr><td width="50%"><code>{OPERA}</code></td><td width="50%">Path of Opera, if installed.</td></tr>
<tr><td width="50%"><code>{GOOGLECHROME}</code></td><td width="50%">Path of Google Chrome (or Chromium
on Unix-like systems), if installed.</td></tr>
<tr><td width="50%"><code>{SAFARI}</code></td><td width="50%">Path of Safari, if installed.</td></tr>
</table>

<p><b>Microsoft Edge.</b>
There exists no placeholder for Edge, because Edge is an app
that cannot be started like a regular Windows application.
In order to open an URL using Edge, prefix the URL with '<code>microsoft-edge:</code>'.
For example, in order to open the URL
<a href="https://keepass.info/" target="_blank">https://keepass.info/</a>
using Edge, use the URL
<a href="microsoft-edge:https://keepass.info/" target="_blank"
rel="nofollow">microsoft-edge:https://keepass.info/</a>.</p>

<br />

<table class="tablebox75">
<tr><th width="50%">Placeholder</th><th width="50%">Is Replaced By</th></tr>
<tr><td width="50%"><code>{APPDIR}</code></td><td width="50%">KeePass application directory path.</td></tr>
</table>

<br />


<table class="tablebox75">
<tr><th width="50%">Placeholder</th><th width="50%">Is Replaced By</th></tr>
<tr><td width="50%"><code>{GROUP}</code></td><td width="50%">Name of the entry's parent group.</td></tr>
<tr><td width="50%"><code>{GROUP_PATH}</code></td><td width="50%">Full group path of the entry.</td></tr>
<tr><td width="50%"><code>{GROUP_NOTES}</code></td><td width="50%">Notes of the entry's parent group.</td></tr>
<tr><td width="50%"><code>{GROUP_SEL}</code></td><td width="50%">Name of the group that is currently selected in the main window.</td></tr>
<tr><td width="50%"><code>{GROUP_SEL_PATH}</code></td><td width="50%">Full path of the group that is currently selected in the main window.</td></tr>
<tr><td width="50%"><code>{GROUP_SEL_NOTES}</code></td><td width="50%">Notes of the group that is currently selected in the main window.</td></tr>
<tr><td width="50%"><code>{DB_PATH}</code></td><td width="50%">Full path of the current database.</td></tr>
<tr><td width="50%"><code>{DB_DIR}</code></td><td width="50%">Directory of the current database.</td></tr>
<tr><td width="50%"><code>{DB_NAME}</code></td><td width="50%">File name (including extension) of the current database.</td></tr>
<tr><td width="50%"><code>{DB_BASENAME}</code></td><td width="50%">File name (excluding extension) of the current database.</td></tr>
<tr><td width="50%"><code>{DB_EXT}</code></td><td width="50%">File name extension of the current database.</td></tr>
<tr><td width="50%"><code>{ENV_DIRSEP}</code></td><td width="50%">Directory separator ('\' on Windows, '/' on Unix).</td></tr>
<tr><td width="50%"><code>{ENV_PROGRAMFILES_X86}</code></td><td width="50%">This is
<code>%ProgramFiles(x86)%</code>, if it exists, otherwise <code>%ProgramFiles%</code>.</td></tr>
</table>


<br />

<table class="tablebox75">
<tr><th width="50%">Placeholder</th><th width="50%">Is Replaced By</th></tr>
<tr><td width="50%"><code>{DT_SIMPLE}</code></td><td width="50%">Current local date/time as a simple,
sortable string. For example, for 2012-07-25 17:05:34 the value is 20120725170534.</td></tr>
<tr><td width="50%"><code>{DT_YEAR}</code></td><td width="50%">Year component of the current local date/time.</td></tr>
<tr><td width="50%"><code>{DT_MONTH}</code></td><td width="50%">Month component of the current local date/time.</td></tr>
<tr><td width="50%"><code>{DT_DAY}</code></td><td width="50%">Day component of the current local date/time.</td></tr>
<tr><td width="50%"><code>{DT_HOUR}</code></td><td width="50%">Hour component of the current local date/time.</td></tr>
<tr><td width="50%"><code>{DT_MINUTE}</code></td><td width="50%">Minute component of the current local date/time.</td></tr>
<tr><td width="50%"><code>{DT_SECOND}</code></td><td width="50%">Seconds component of the current local date/time.</td></tr>
<tr><td width="50%"><code>{DT_UTC_SIMPLE}</code></td><td width="50%">Current UTC date/time as a simple, sortable string.</td></tr>
<tr><td width="50%"><code>{DT_UTC_YEAR}</code></td><td width="50%">Year component of the current UTC date/time.</td></tr>
<tr><td width="50%"><code>{DT_UTC_MONTH}</code></td><td width="50%">Month component of the current UTC date/time.</td></tr>
<tr><td width="50%"><code>{DT_UTC_DAY}</code></td><td width="50%">Day component of the current UTC date/time.</td></tr>
<tr><td width="50%"><code>{DT_UTC_HOUR}</code></td><td width="50%">Hour component of the current UTC date/time.</td></tr>
<tr><td width="50%"><code>{DT_UTC_MINUTE}</code></td><td width="50%">Minute component of the current UTC date/time.</td></tr>
<tr><td width="50%"><code>{DT_UTC_SECOND}</code></td><td width="50%">Seconds component of the current UTC date/time.</td></tr>
</table>

<br /><br />

<a name="envvars"></a>
<h2 class="sectiontitle"><img src="../images/b16x16_konsole.png"
class="singleimg" alt="Placeholder" />&nbsp;&nbsp;Environment Variables</h2>

<p>System environment variables are supported.
The name of the variable must be enclosed in '<code>%</code>' characters.
For example <code>%TEMP%</code> is replaced by the user's temporary path.</p>

<br />

<a name="texttrf"></a>
<h2 class="sectiontitle"><img src="../images/ascii.png"
class="singleimg" alt="Text" />&nbsp;&nbsp;Text Transformations</h2>

<br />


<table class="tablebox75">
<tr><th width="50%">Placeholder</th><th width="50%">Action</th></tr>
<tr><td width="50%"><code>{T-REPLACE-RX:/<i>Text</i>/<i>Search</i>/<i>Replace</i>/}</code></td>
<td width="50%">Searches the regular expression <em>Search</em> in <em>Text</em>
and replaces all matches by <em>Replace</em>.
See <a href="#replacerx">below</a>.</td></tr>
<tr><td width="50%"><code>{T-CONV:/<i>Text</i>/<i>Type</i>/}</code></td>
<td width="50%">Convert <em>Text</em> to <em>Type</em>.
See <a href="#conv">below</a>.</td></tr>
</table>


<br /><br />

<a name="replacerx"></a>

<b><code>{T-REPLACE-RX:/<i>Text</i>/<i>Search</i>/<i>Replace</i>/}</code> &#8211; Replace
Using Regular Expression:</b><br />
This placeholder
searches the <a href="https://msdn.microsoft.com/en-us/library/az24scfc.aspx"
target="_blank">regular expression</a> <em>Search</em> in <em>Text</em>
and replaces all matches by <em>Replace</em>.<br />
<br />
All parameters are Spr-compiled, i.e. placeholders can be used within them.<br />
<br />
The first character after the first '<code>:</code>' specifies the
separator character. Any character except '<code>}</code>' can be used as separator
character.
It must not appear within the parameters.
For example,
<code>{T-REPLACE-RX:/A/B/C/}</code> and
<code>{T-REPLACE-RX:!A!B!C!}</code> are equivalent.
The last separator character (before the '<code>}</code>') is required.<br />
<br />
<em>Usage example.</em>
Let the user name field contain the e-mail address '<code>myname@example.com</code>' and
the URL field '<code>{T-REPLACE-RX:!{USERNAME}!.*@(.*)!https://$1!}</code>'.
When running the URL field, KeePass opens
'<code>https://example.com</code>'.


<br /><br />

<a name="conv"></a>

<b><code>{T-CONV:/<i>Text</i>/<i>Type</i>/}</code> &#8211; Convert:</b><br />
This placeholder converts <em>Text</em> to <em>Type</em>.<br />
<br />
All parameters are Spr-compiled, i.e. placeholders can be used within them.<br />
<br />
Supported types are:
<ul>
<li><b>Upper</b> or <b>U</b>:<br />
Upper-case.</li>
<li><b>Lower</b> or <b>L</b>:<br />
Lower-case.<br />
<em>Example.</em>
Let the user name of an entry be '<code>Bob</code>' and
the URL '<code>https://example.com/?user={T-CONV:/{USERNAME}/L/}</code>'.
When running the URL, KeePass opens
'<code>https://example.com/?user=bob</code>'.</li>
<li><b>Base64</b>:<br />
The Base64 encoding of the UTF-8 representation of the text.</li>
<li><b>Hex</b>:<br />
The Hex encoding of the UTF-8 representation of the text.</li>
<li><b>Uri</b>:<br />
The URI-escaped representation of the text.</li>
<li><b>Uri-Dec</b>:<br />
The URI-unescaped representation of the text.</li>
<li><b>Raw</b>:<br />
Spr-compiles <em>Text</em> without encoding the result for the current context.<br />
<em>Example.</em>
Let the user name of an entry be '<code>+</code>'.
The auto-type sequence '<code>{USERNAME}a</code>' results in the text
'<code>+a</code>', whereas the auto-type sequence
'<code>{T-CONV:/{USERNAME}/Raw/}a</code>' results in the text
'<code>A</code>'
(because this placeholder inserts '<code>+</code>' into the auto-type
sequence without encoding it, and
'<code>+a</code>' means to press <kbd><kbd>Shift</kbd>+<kbd>A</kbd></kbd>,
which results in the text '<code>A</code>').</li>
</ul>


<br /><br />

<a name="plh"></a>
<h2 class="sectiontitle"><img src="../images/b16x16_chardevice.png"
class="singleimg" alt="Placeholder" />&nbsp;&nbsp;Other Placeholders</h2>

<br />


<table class="tablebox75">
<tr><th width="50%">Placeholder</th><th width="50%">Action</th></tr>
<tr><td width="50%"><code>{PICKCHARS}</code><br />
<code>{PICKCHARS:<i>Fld</i>:<i>Opt</i>}</code></td><td width="50%">Shows a dialog to pick certain characters from an entry string.
See <a href="#pickchars">below</a>.</td></tr>
<tr><td width="50%"><code>{PICKFIELD}</code></td><td width="50%">Shows a dialog to pick a field
whose value will be inserted.</td></tr>
<tr><td width="50%"><code>{NEWPASSWORD}</code><br />
<code>{NEWPASSWORD:/<em>Profile</em>/}</code></td><td width="50%">Generates a new password.
See <a href="#newpassword">below</a>.</td></tr>
<tr><td width="50%"><code>{PASSWORD_ENC}</code></td><td width="50%">Password in encrypted form.
See <a href="#passwordenc">below</a>.</td></tr>
<tr><td width="50%"><code>{HMACOTP}</code></td><td width="50%">Generates a one-time password.
See <a href="#hmacotp">below</a>.</td></tr>
<tr><td width="50%"><code>{C:<i>Comment</i>}</code></td><td width="50%">Comment; is removed.</td></tr>
<tr><td width="50%"><code>{BASE}</code><br />
<code>{BASE:RMVSCM}</code><br />
<code>{BASE:SCM}</code><br />
<code>{BASE:HOST}</code><br />
<code>{BASE:PORT}</code><br />
<code>{BASE:PATH}</code><br />
<code>{BASE:QUERY}</code><br />
<code>{BASE:USERINFO}</code><br />
<code>{BASE:USERNAME}</code><br />
<code>{BASE:PASSWORD}</code></td><td width="50%">Within an URL override,
each of these placeholders is replaced by the specified part of the string that is
being overridden.
See <a href="#url">below</a>.</td></tr>
<tr><td width="50%"><code>{CMD:/<i>CommandLine</i>/<i>Options</i>/}</code></td>
<td width="50%">Runs a command line. See <a href="#cmd">below</a>.</td></tr>
</table>


<!-- <a name="pickpasswordchars"></a>
<b>Picking Password Characters:</b><br />
The password character picking dialog can be invoked multiple times in one
auto-typing sequence. Use <code>{PICKPASSWORDCHARS}</code> first, then append
numbers starting with 2, i.e. <code>{PICKPASSWORDCHARS2}</code>,
<code>{PICKPASSWORDCHARS3}</code>, etc.<br />
<br />
You can additionally specify the number of characters
to pick. To do this, append <code>:k</code> in the placeholder, where
<code>k</code> is the number of characters. For example,
<code>{PICKPASSWORDCHARS2:5}</code> is a placeholder with ID 2 and will
allow to pick 5 characters. Advantage of predefining the number of characters:
when enough characters have been picked, the dialog closes automatically,
i.e. you don't need to click [OK] anymore. -->

<br /><br />

<a name="pickchars"></a>

<b><code>{PICKCHARS}</code> &#8211; Picking Characters:</b><br />
<a href="https://keepass.info/screenshots/windows_vista/pickchars_big.png"
target="_blank"><img src="../../screenshots/windows_vista/pickchars.png"
align="right" alt="Character Picking Dialog" /></a>
The <code>{PICKCHARS}</code> placeholder shows a dialog, in which you can
pick characters of an entry string (like the password) at certain positions.<br />
<br />
<code>{PICKCHARS}</code> without any parameters lets you pick an arbitrary
amount of characters from the password of the entry.
A different entry string can be specified by appending a '<code>:</code>'
and the name of the field; e.g. <code>{PICKCHARS:UserName}</code>.
The names of the standard fields are <i>Title</i>, <i>UserName</i> (without a space),
<i>Password</i>, <i>URL</i> and <i>Notes</i>. A custom entry string can
be referenced by its name (without an <code>S:</code> prefix).<br />
<br />
Additionally, the placeholder supports various (optional!) options. Options are appended
after the field name, separated by a '<code>:</code>'. If you want to specify
multiple options, separate them by a comma '<code>,</code>'. Options are
key-value pairs, separated by a '<code>=</code>'. The following options
are supported:
<ul>
<li><b>ID</b>: Specifies an alphanumeric ID for the placeholder (see below).</li>
<li><b>C</b> or <b>Count</b>: Specifies the number of characters to pick from
the string. When enough characters have been picked,
the dialog closes automatically (i.e. you don't need to manually click [OK]
anymore).</li>
<li><b>Hide</b>: If set to <i>False</i>, the picked characters in the dialog
are shown as plain text by default, i.e. not hidden by asterisks.
By default, KeePass uses the hiding setting of passwords in the main window.</li>
<li><b>Conv</b>: Specifies how to convert the picked characters.
When this parameter is omitted, no conversion is performed, i.e. the selected
characters are auto-typed directly. The option supports the following values:
<ul>
<li><b>D</b>: Convert the picked characters to down arrow keypresses; e.g.
'2', 'c' and 'C' are converted to 2 down arrow keypresses.<br />
<br />
A fixed number of
down arrow keypresses can be added by specifying them using the <b>Conv-Offset</b>
option. For example, if you specify <code>Conv=D, Conv-Offset=1</code>,
then '2', 'c' and 'C' are converted to 3 down arrow keypresses.<br />
<br />
By using the <b>Conv-Fmt</b> option, you can specify the layout of comboboxes.
By default, KeePass assumes a combobox containing values from 0 to 9 <i>or</i> from A to Z.
If the combobox contains values 0-9A-Z (i.e. first all ten digits, immediately followed
by all characters from A to Z), specify <code>Conv=D, Conv-Fmt=0A</code>.
Similarly, if it contains values A-Z0-9, specify <code>Conv=D, Conv-Fmt=A0</code>.
If digits start with 1 instead of 0 (i.e. the 0 appears after the 9), use
<code>1A</code> and <code>A1</code> instead of <code>0A</code> and <code>A0</code>.
If the combobox contains values 0-9A-Za-z (i.e. case-sensitive characters),
specify <code>0Aa</code>. All combinations of '<code>0</code>', '<code>A</code>',
'<code>a</code>' and '<code>?</code>' are supported.
If '<code>A</code>' and '<code>a</code>' are not specified both,
characters are treated as case-insensitive.
'<code>?</code>' skips a combobox item.</li>
</ul></li>
</ul>
If you want to show the character picking dialog multiple times within one sequence,
assign different IDs to the placeholders.
If an ID is specified multiple times (or no ID is specified
and the placeholders are the same),
KeePass shows the character picking dialog once and reuses the picked characters
in all following placeholders with the same ID.<br />
<br />
<em>Usage examples</em>:<br />
<br />
<code>{USERNAME}{TAB}{PICKCHARS:Password:C=5}{ENTER}</code><br />
First a dialog is shown in which the user can pick exactly 5 characters
from the entry password.
Afterwards KeePass types the user name into the target window, presses Tab,
types the 5 picked characters and presses Enter.<br />
<br />
<a href="https://keepass.info/screenshots/windows_vista/comboboxform_big.png"
target="_blank"><img src="../../screenshots/windows_vista/comboboxform.png"
align="right" alt="ComboBox Form" /></a>
<code>{S:Memorable}{TAB}{PICKCHARS:Password:ID=1, C=1, Conv=D,
Conv-Offset=1}{TAB}{PICKCHARS:Password:ID=2, C=1, Conv=D,
Conv-Offset=1}{TAB}{PICKCHARS:Password:ID=3, C=1, Conv=D,
Conv-Offset=1}{ENTER}</code><br />
First the character picking dialog is shown three times and each time the user
can pick exactly one character from the entry password.
Afterwards the auto-type process starts:
KeePass types the contents of a custom entry string named &quot;Memorable&quot;
into the target window.
The focus is switched to the next control by pressing Tab,
and the first previously picked character is converted to
down arrow keypresses (with one additional keypress; e.g. a '1' is converted
to two down arrow keypresses).
This is repeated two more times with the other picked characters,
and finally Enter is pressed.<br />
<br />
Note this is not equivalent to picking three characters at once.
If you'd use <code>{S:Memorable}{TAB}{PICKCHARS:Password:C=3, Conv=D, Conv-Offset=1}</code>,
all the down arrow keypresses are sent to the same, currently active control.<br />
<br />
In some browsers (e.g. Opera), setting the focus to a combobox can
be slow. If you experience auto-type failures, consider slowing down
the focus changes, e.g. by adding <code>{DELAY 250}</code> after each <code>{TAB}</code>,
or slowing down the whole sequence, e.g. by prepending <code>{DELAY=150}</code>.


<br /><br />

<a name="newpassword"></a>

<b><code>{NEWPASSWORD}</code> and <code>{NEWPASSWORD:/<em>Profile</em>/}</code>
&#8211; Generating New Passwords:</b><br />
The <code>{NEWPASSWORD}</code> placeholder
generates a new password for the current entry, based on the 'Automatically
generated passwords for new entries' generator profile.<br />
<br />
This placeholder is evaluated only once in an auto-type process, i.e.
for a typical 'Old Password' - 'New Password' - 'Repeat New Password'
dialog you can use
<code>{PASSWORD}{TAB}{NEWPASSWORD}{TAB}{NEWPASSWORD}{ENTER}</code>
as auto-type sequence.<br />
<br />
In order to use a different password generator profile, use
<code>{NEWPASSWORD:/<em>Profile</em>/}</code>, where <em>Profile</em>
is the name of the profile.
If the specified profile cannot be found, the
'Automatically generated passwords for new entries' profile is used.<br />
<br />
When specifying '<code>~</code>' as name of the profile
(i.e. when using the placeholder <code>{NEWPASSWORD:/~/}</code>), KeePass derives
a profile from the current entry password.
Not recommended, as the quality can decay.


<br /><br />

<a name="passwordenc"></a>

<b><code>{PASSWORD_ENC}</code> &#8211; Encrypting Passwords:</b><br />
The <code>{PASSWORD_ENC}</code> placeholder is replaced by the password
of the current entry in encrypted form. The password is encrypted using
credentials of the current Windows user. The encrypted password should
not be stored and only works for the current user.<br />
<br />
It is intended to be used in conjunction with the
<code>-pw-enc</code> <a href="cmdline.html">command line</a> parameter
(see the <a href="autourl.html">URL Field Capabilities</a> page for
an example how to define an URL to open an additional KeePass database).
The placeholder cannot be used to transfer passwords to other applications
(except KeePass), because the target applications don't know how to decrypt
encrypted passwords generated by <code>{PASSWORD_ENC}</code>.


<br /><br />

<a name="hmacotp"></a>

<b><code>{HMACOTP}</code> &#8211; Generating One-Time Passwords:</b><br />
The <code>{HMACOTP}</code> placeholder
generates a HMAC-based one-time password as specified in RFC 4226.
The shared secret can be specified using one of the following
entry string fields:
<code>HmacOtp-Secret</code> (the UTF-8 representation of the value is the secret),
<code>HmacOtp-Secret-Hex</code> (secret as hex string),
<code>HmacOtp-Secret-Base32</code> (secret as Base32 string) or
<code>HmacOtp-Secret-Base64</code> (secret as Base64 string).
The counter is stored in decimal form in the <code>HmacOtp-Counter</code> field.<br />
<br />
<em>Usage example.</em>
Create a new entry, set its password to the <code>{HMACOTP}</code>
placeholder, switch to the 'Advanced' tab, add a string named
<code>HmacOtp-Secret</code> with value 12345678901234567890,
and add a string named <code>HmacOtp-Counter</code> with value 0.
When you now double-click onto the password cell of the entry in the
entry list of the main window, an OTP is copied to the
clipboard. When auto-typing, an OTP is sent as password.
Each time you perform such an action, KeePass updates the counter value.
With the secret key and counter values above, the following OTPs
are generated: 755224, 287082, 359152, 969429, 338314, ...
(more generated OTPs can be found in the example in RFC 4226).


<br /><br />

<a name="url"></a>

<b><code>{URL:...}</code> and <code>{BASE:...}</code>:</b><br />
The <code>{URL:...}</code> placeholder is replaced by the specified part
of the current entry's URL; this typically is useful in an
entry-specific URL override (defined on the 'Properties' tab of the entry dialog).
The <code>{BASE:...}</code> placeholder is replaced by the specified part
of the URL being overridden; this typically is useful in a
global URL override (defined in 'Tools' &rarr; 'Options' &rarr; tab 'Integration' &rarr;
button 'URL Overrides'), because there no entry context may be available.<br />
<br />
<em>Usage example.</em> For the entry URL
<code>https://user:pw@keepass.info:80/path/example.php?q=e&amp;s=t</code>,
the placeholders return the following values:<br />
<br />
<table class="tablebox75">
<tr><th width="25%">Placeholder</th><th width="75%">Value</th></tr>
<tr><td width="25%"><code>{URL}</code></td>
<td width="75%"><code>https://user:pw@keepass.info:80/path/example.php?q=e&amp;s=t</code></td></tr>
<tr><td width="25%"><code>{URL:RMVSCM}</code></td>
<td width="75%"><code>user:pw@keepass.info:80/path/example.php?q=e&amp;s=t</code></td></tr>
<tr><td width="25%"><code>{URL:SCM}</code></td>
<td width="75%"><code>https</code></td></tr>
<tr><td width="25%"><code>{URL:HOST}</code></td>
<td width="75%"><code>keepass.info</code></td></tr>
<tr><td width="25%"><code>{URL:PORT}</code></td>
<td width="75%"><code>80</code></td></tr>
<tr><td width="25%"><code>{URL:PATH}</code></td>
<td width="75%"><code>/path/example.php</code></td></tr>
<tr><td width="25%"><code>{URL:QUERY}</code></td>
<td width="75%"><code>?q=e&amp;s=t</code></td></tr>
<tr><td width="25%"><code>{URL:USERINFO}</code></td>
<td width="75%"><code>user:pw</code></td></tr>
<tr><td width="25%"><code>{URL:USERNAME}</code></td>
<td width="75%"><code>user</code></td></tr>
<tr><td width="25%"><code>{URL:PASSWORD}</code></td>
<td width="75%"><code>pw</code></td></tr>
</table>
<br />
<code>{BASE}</code> supports exactly the same parts as <code>{URL}</code>.


<br /><br />

<a name="cmd"></a>

<b><code>{CMD:/<i>CommandLine</i>/<i>Options</i>/}</code> &#8211; Running a command line:</b><br />
The <code>{CMD:/<i>CommandLine</i>/<i>Options</i>/}</code> placeholder
runs the specified command line.<br />
<br />
A command line consists of a path to an executable file or a document
and command line parameters.
If the path contains spaces, it must be enclosed in quotes (<code>&quot;</code>).<br />
<br />
The character after the first '<code>:</code>' specifies the separator
character. It can be chosen freely (except '<code>{</code>' and '<code>}</code>'),
but it must not occur in the command line or any of the options.
For example, <code>{CMD:/Notepad.exe/W=0/}</code> and
<code>{CMD:!Notepad.exe!W=0!}</code> are equivalent.
The separator character at the end (before the '<code>}</code>') is mandatory.<br />
<br />
An option is a key-value pair, separated by '<code>=</code>'.
Multiple options must be separated using commas '<code>,</code>'.<br />
<br />
Options:
<ul>
<li><strong><code>M</code></strong>:
Specifies the method for running/opening the executable/document.<br />
The default value is <code>S</code>.
<ul>
<li><strong><code>S</code></strong>:
Use the system shell (via <code>ShellExecute</code>).
With this, executable files are executed and documents are opened
using their associated applications.
However, no standard input/output is supported.</li>
<li><strong><code>C</code></strong>:
Run an executable file (EXE or COM, via <code>CreateProcess</code>);
documents are not supported.
Standard input/output is supported.</li>
</ul>
</li>

<li><strong><code>O</code></strong>:
Specifies what to do with the standard output of the executed application.<br />
The default value is <code>1</code>.
<ul>
<li><strong><code>0</code></strong>:
Ignore the standard output. The placeholder is replaced by an empty string.</li>
<li><strong><code>1</code></strong>:
Replace the placeholder by the standard output.</li>
</ul>
</li>

<li><strong><code>W</code></strong>:
Specifies whether to wait for the termination of the executed application.<br />
The default value is <code>1</code>.
<ul>
<li><strong><code>0</code></strong>:
Do not wait.</li>
<li><strong><code>1</code></strong>:
Wait.</li>
</ul>
</li>

<li><strong><code>WS</code></strong>:
Specifies the window style. Not all applications support this option.<br />
The default value is <code>N</code>.
<ul>
<li><strong><code>N</code></strong>:
Normal.</li>
<li><strong><code>H</code></strong>:
Hidden.</li>
<li><strong><code>Min</code></strong>:
Minimized.</li>
<li><strong><code>Max</code></strong>:
Maximized.</li>
</ul>
</li>

<li><strong><code>V</code></strong>:
Specifies the verb (action to be performed),
e.g. 'Open' or 'Print'.
When using the verb 'RunAs', the application is executed with administrative
rights (this may require a confirmation via the UAC dialog).</li>
</ul>

<em>Usage examples:</em>
<ul>
<li><code>{CMD:/Notepad.exe/W=0/}</code><br />
Runs Notepad and continues immediately.</li>
<li><code>{CMD:/PowerShell.exe -Command &quot;(Get-FileHash '%SYSTEMROOT%\Win.ini'
-Algorithm SHA256).Hash&quot;/M=C,WS=H/}</code><br />
The placeholder is replaced by the SHA-256 hash of Windows' Win.ini file.</li>
</ul>


</body></html>