File: autourl.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 (261 lines) | stat: -rw-r--r-- 11,372 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
<!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="URL Field Capabilities - 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>URL Field Capabilities - 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_enhanced_browsing.png" width="64" height="64"
class="singleimg" align="left" alt="URL Field" />
</td><td valign="middle"><h1>URL Field Capabilities</h1><br />
The URL field supports various special protocols and placeholders.
</td></tr></table>

<br />
URL Field Capabibilities:
<ul>
<li><a href="#stdcp">Standard Capabilities</a></li>
<li><a href="#cmdln">Executing Command Lines</a></li>
<li><a href="#subst">Placeholders</a></li>
<li><a href="#override">Changing the URL Handler (URL Override)</a></li>
</ul>

Usage Tips &amp; Tricks:
<ul>
<li><a href="#rdpts">Starting RDP/TS Sessions (Remote Desktop / Terminal Server Connection)</a></li>
<li><a href="#builtin">Executing Built-In Shell Commands</a></li>
</ul>

<br />

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

<p>The URL field can execute any valid URL for which a protocol handler is defined.
On most systems at least the <code>http://</code>, <code>https://</code>,
<code>ftp://</code> and <code>mailto:</code> protocols are defined.
KeePass supports all protocols that Windows supports.</p>

<p>For example, if you globally (i.e. using the Windows Explorer) register PuTTY for <code>ssh://</code> URLs,
KeePass will automatically use PuTTY for <code>ssh://</code> URLs, too.</p>

<br />

<a name="cmdln"></a>
<h2 class="sectiontitle">
<img src="../images/b16x16_openterm.png" class="singleimg" alt="Terminal" />&nbsp;&nbsp;Executing
Command Lines</h2>

<p>Instead of an URL, you can also execute command lines using the URL field.
To tell KeePass that the line you entered
is a command line, prefix it using <code>cmd://</code>. For example if you would like to execute
Notepad, your URL could look like this:</p>

<pre>cmd://C:\Windows\Notepad.exe C:\Test\MyTestFile.txt</pre>

<p>The virtual <code>cmd://</code> protocol also supports parameters for executable
files, in contrast to
the <code>file://</code> protocol. This was the main reason why <code>cmd://</code>
was introduced; with <code>file://</code> you
aren't able to pass any parameters to started applications. Use the <code>cmd://</code>
protocol instead.</p>

<p>The paths for the <code>cmd://</code> protocol don't need to be encoded. For example,
you do not have to replace space characters by <code>%20</code>, as it is normally
required for other URLs. KeePass just cuts away the <code>cmd://</code> virtual
protocol prefix and passes the remaining command line to the system.</p>

<p>If the file path contains spaces, you must enclose it in quotes (&quot;).</p>

<p><b>Environment Variables:</b><br />
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>

<p><b>UNC Paths:</b><br />
Windows-style UNC paths (starting with <code>\\</code>) are directly
supported, i.e. do not need to be prefixed with <code>cmd://</code>.</p>

<br />

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

<p>In the URL field, you can use several placeholders that will get automatically replaced
when the URL is executed. For example:</p>

<pre>https://www.example.com/default.php?user={USERNAME}&amp;pass={PASSWORD}</pre>

<p>For this entry, KeePass will replace {USERNAME} by the data of the username field and {PASSWORD}
by the data in the password field when you execute the link.</p>

<p>For a complete list of supported placeholders, see the page
<a href="placeholders.html">Placeholders</a>.</p>

<p>Also note that the special placeholders are supported, too. For example,
the <code>{APPDIR}</code> placeholder is replaced by the application
directory path of the currently running KeePass instance. It's the absolute path of the
directory containing the KeePass executable, without a trailing backslash.
If you would like to start a new KeePass instance, you could set the URL to:</p>

<pre>cmd://&quot;{APPDIR}\KeePass.exe&quot;</pre>

<p>To use different browsers for entries, you can use URLs like the following:<br />
<code>cmd://{INTERNETEXPLORER} &quot;https://www.example.com/&quot;</code><br />
<code>cmd://{FIREFOX} &quot;https://www.example.com/&quot;</code><br />
<code>cmd://{OPERA} &quot;https://www.example.com/&quot;</code><br />
<code>cmd://{GOOGLECHROME} &quot;https://www.example.com/&quot;</code><br />
<code>cmd://{SAFARI} &quot;https://www.example.com/&quot;</code><br />
The browser placeholder will be replaced by the browser's executable path (if the
browser is installed).</p>

<br />

<a name="override"></a>
<h2 class="sectiontitle">
<img src="../images/ascii.png" class="singleimg" alt="Text" />&nbsp;&nbsp;Changing
the URL Handler (URL Override)</h2>

<br />






<p>The URL field behavior can be overridden individually for each entry
using the field 'Override URL' (tab 'Properties' in the entry dialog).
This allows you to execute a specific URL, while still using the URL
field to (only) store data.
When double-clicking the URL field of the entry in the main window, the
specified command line (in the URL override field) will be run.</p>

<p><b>Using a different browser:</b><br />
If your default browser is Firefox and you want to open a specific site with
Internet Explorer, specify the following in the URL override field:</p>

<p><code>cmd://{INTERNETEXPLORER} &quot;{URL}&quot;</code></p>

<p>KeePass will open Internet Explorer and pass the data from the URL field
as the parameter. This uses a <a href="#subst">placeholder</a> to find Internet
Explorer.</p>

<p><b>Globally changing the URL behavior:</b><br />
If you want to change the <i>default</i> URL action for an URL scheme
(e.g. <code>http://</code>, <code>https://</code> or <code>ftp://</code>),
you can define an URL scheme override
in 'Tools' &rarr; 'Options' &rarr; tab 'Integration' &rarr; 'URL Overrides'.
This for example allows to specify a browser as default for websites
(in the dialog you can find several overrides for browsers like Internet Explorer,
Mozilla Firefox, Opera and Google Chrome).</p>

<p>URL scheme overrides can also be used to define new protocols. For example,
if you want to define a protocol <code>kdbx://</code> that opens another KeePass database,
specify the following as override for the kdbx scheme (on Windows):<br />
<code>cmd://&quot;{APPDIR}\KeePass.exe&quot; &quot;{BASE:RMVSCM}&quot; -pw-enc:&quot;{PASSWORD_ENC}&quot;</code><br />
or on Unix-like systems (Mono):<br />
<code>cmd://mono &quot;{APPDIR}/KeePass.exe&quot; &quot;{BASE:RMVSCM}&quot; -pw-enc:&quot;{PASSWORD_ENC}&quot;</code><br />
If an entry now has an URL looking like <code>kdbx://<i>PathToYourDatabase.kdbx</i></code>
and the master password for this database in the password field,
double-clicking the URL of the entry in the main window opens the other database.
The <code>-pw-enc</code> <a href="cmdline.html">command line</a> parameter and
the <a href="placeholders.html#passwordenc"><code>{PASSWORD_ENC}</code></a> placeholder
allow passing the master password of the other database in encrypted form,
i.e. process monitors and similar utilities aren't be able to read the master password.</p>


<br /><br />

<a name="rdpts"></a>
<h2 class="sectiontitle">
<img src="../images/b16x16_openterm.png" class="singleimg" alt="Terminal" />&nbsp;&nbsp;Starting
RDP/TS Sessions</h2>

<p>You can use the URL field of entries and the virtual <code>cmd://</code>
protocol to start remote desktop connections.</p>

<p>For this, enter the following in the URL field of an entry:</p>

<pre>cmd://mstsc.exe</pre>

<p>When you now double-click the URL field of the entry in the main window, a
Windows remote desktop connection is initiated.</p>

<p>MSTSC is the Windows terminal server connection program (remote desktop connection).
You can pass a path to an existing RDP file to the program to open it. For example,
the following URL opens the specified RDP file:</p>

<pre>cmd://mstsc.exe &quot;C:\My Files\Connection.rdp&quot;</pre>

<p>MSTSC also supports several command line options:</p>

<ul>
<li><b>/v:&lt;Server[:Port]&gt;</b><br />Defines the terminal server to connect to.</li>
<li><b>/console</b><br />Connects to the terminal session of the server.</li>
<li><b>/f</b><br />Starts the client in full screen mode.</li>
<li><b>/w:&lt;Width&gt;</b><br />Defines the width of the remote desktop screen.</li>
<li><b>/h:&lt;Height&gt;</b><br />Defines the height of the remote desktop screen.</li>
<li><b>/edit</b><br />Opens the specified RDP file for editing.</li>
<li><b>/migrate</b><br />Migrates old connection files to new RDP files.</li>
</ul>

<br />

<a name="builtin"></a>
<h2 class="sectiontitle">
<img src="../images/b16x16_openterm.png" class="singleimg" alt="Terminal" />&nbsp;&nbsp;Executing
Built-In Shell Commands</h2>

<p>The URL field can be used to start applications/documents and URLs.
If you want to execute a built-in shell command, like <code>COPY</code> for
example, this however doesn't work directly, because there is no <code>COPY.EXE</code>
(in Windows 9x times there actually was one, but on all modern Windows operating
systems these commands are built-in to the command line window).</p>

<p>In order to execute built-in shell commands, you need to pass them to the
command line interpreter <code>cmd.exe</code>.</p>

<p>For the <code>COPY</code> command you would specify <code>cmd.exe</code>
as executable file and <code>/C COPY from to</code> as arguments (where
'<code>from</code>' and '<code>to</code>' are paths). The <code>/C</code>
parameter tells <code>cmd.exe</code> to execute the command line that
follows.</p>

<p>In the URL field, your URL would look like the following:<br />
<code>cmd://cmd.exe /C COPY from to</code><br />
In other locations, like command lines in the trigger system,
you can leave out the <code>cmd://</code> URL prefix.</p>

</body></html>