Skip to content

Commit 8a2f21a

Browse files
authored
docs: adopt suggestions from tomasz1986
improve docs by putting hard instructions on the end section also hide VBScript due to future deprecation
1 parent 893167c commit 8a2f21a

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

users/autostart.rst

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,8 @@ start Syncthing automatically either at user log on, or at system
3434
startup. In both cases, Syncthing will open and stay invisible in
3535
background.
3636

37-
It's possible to run Windows Task Scheduler CLI API with a command such as
38-
``schtasks /create /sc ONLOGON /tn Syncthing /tr "<program-path> [--no-console --no-browser]"``.
39-
The operation requires elevated privileges. Preventing the pop-up console that hides after
40-
some delay is possible wrapping the executable with a ``.vbs or .ps1``.
41-
42-
vbs::
43-
44-
Dim objShell
45-
Set objShell = CreateObject("WScript.Shell")
46-
objShell.Run "path to syncthing.exe", 0, False
47-
Set objShell = Nothing
48-
49-
ps1::
50-
51-
Start-Process "path to syncthing.exe" -WindowStyle Hidden
52-
5337
For technical information about Task Scheduler visit
5438
https://docs.microsoft.com/windows/win32/taskschd
55-
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks
56-
57-
Or follow the Graphical tutorial below:
5839

5940
#. Start the Task Scheduler either by going to ``Start Menu > Windows
6041
Administrative Tools`` and clicking on ``Task Scheduler``, or by
@@ -271,6 +252,26 @@ by a sysadmin who knows enough to understand the security implications.
271252
#. Start the service via ``sc start syncthing`` in the Command Prompt.
272253
#. Connect to the Syncthing UI, enable HTTPS, and set a secure username and password.
273254

255+
For Hard Users
256+
^^^^^^^^^^^^^^
257+
258+
It's possible to run Windows Task Scheduler CLI API with a command such as
259+
``schtasks /create /sc ONLOGON /tn Syncthing /tr "<program-path> [--no-console --no-browser]"``.
260+
The operation requires elevated privileges. Preventing the pop-up console that hides after
261+
some delay is possible wrapping the executable with a ``PowerShell`` script.
262+
263+
``script.ps1``::
264+
265+
Start-Process "<path to syncthing>.exe" -WindowStyle Hidden
266+
267+
Then run as admin::
268+
269+
schtasks /create /sc ONLOGON /tn Syncthing /tr "powershell <path to script>.ps1"
270+
271+
272+
For more information, please read official docs for Command Line Interface API:
273+
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks
274+
274275
macOS
275276
-----
276277

0 commit comments

Comments
 (0)