Skip to content

docs: add more context to Windows execution #926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion users/autostart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ startup. In both cases, Syncthing will open and stay invisible in
background.

For technical information about Task Scheduler visit
https://docs.microsoft.com/windows/win32/taskschd.
https://docs.microsoft.com/windows/win32/taskschd

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

For Hard Users
^^^^^^^^^^^^^^

It's possible to run Windows Task Scheduler CLI API with a command such as
``schtasks /create /sc ONLOGON /tn Syncthing /tr "<program-path> [--no-console --no-browser]"``.
The operation requires elevated privileges. Preventing the pop-up console that hides after
some delay is possible wrapping the executable with a ``PowerShell`` script.

``script.ps1``::

Start-Process "<path to syncthing>.exe" -WindowStyle Hidden

Then run as admin::

schtasks /create /sc ONLOGON /tn Syncthing /tr "powershell <path to script>.ps1"


For more information, please read official docs for Command Line Interface API:
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks

macOS
-----

Expand Down