From 893167c49d85aa96f72a3ac53ead1b4489f19b5f Mon Sep 17 00:00:00 2001 From: Rafael Ledo Date: Wed, 7 May 2025 02:52:41 -0300 Subject: [PATCH 1/4] docs: add more context to Windows execution additional information on running with command line interface and hiding the console pop-up --- users/autostart.rst | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/users/autostart.rst b/users/autostart.rst index 84d60b0eb..1f76156f9 100644 --- a/users/autostart.rst +++ b/users/autostart.rst @@ -34,8 +34,27 @@ start Syncthing automatically either at user log on, or at system startup. In both cases, Syncthing will open and stay invisible in background. +It's possible to run Windows Task Scheduler CLI API with a command such as +``schtasks /create /sc ONLOGON /tn Syncthing /tr " [--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 ``.vbs or .ps1``. + +vbs:: + + Dim objShell + Set objShell = CreateObject("WScript.Shell") + objShell.Run "path to syncthing.exe", 0, False + Set objShell = Nothing + +ps1:: + + Start-Process "path to syncthing.exe" -WindowStyle Hidden + For technical information about Task Scheduler visit -https://docs.microsoft.com/windows/win32/taskschd. +https://docs.microsoft.com/windows/win32/taskschd +https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks + +Or follow the Graphical tutorial below: #. Start the Task Scheduler either by going to ``Start Menu > Windows Administrative Tools`` and clicking on ``Task Scheduler``, or by From 8a2f21a225a2ab2be2cb39ea143247fd04d26ae3 Mon Sep 17 00:00:00 2001 From: Rafael Ledo Date: Thu, 8 May 2025 02:33:17 -0300 Subject: [PATCH 2/4] docs: adopt suggestions from tomasz1986 improve docs by putting hard instructions on the end section also hide VBScript due to future deprecation --- users/autostart.rst | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/users/autostart.rst b/users/autostart.rst index 1f76156f9..679beefb8 100644 --- a/users/autostart.rst +++ b/users/autostart.rst @@ -34,27 +34,8 @@ start Syncthing automatically either at user log on, or at system startup. In both cases, Syncthing will open and stay invisible in background. -It's possible to run Windows Task Scheduler CLI API with a command such as -``schtasks /create /sc ONLOGON /tn Syncthing /tr " [--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 ``.vbs or .ps1``. - -vbs:: - - Dim objShell - Set objShell = CreateObject("WScript.Shell") - objShell.Run "path to syncthing.exe", 0, False - Set objShell = Nothing - -ps1:: - - Start-Process "path to syncthing.exe" -WindowStyle Hidden - For technical information about Task Scheduler visit https://docs.microsoft.com/windows/win32/taskschd -https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks - -Or follow the Graphical tutorial below: #. Start the Task Scheduler either by going to ``Start Menu > Windows Administrative Tools`` and clicking on ``Task Scheduler``, or by @@ -271,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 " [--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 ".exe" -WindowStyle Hidden + +Then run as admin:: + + schtasks /create /sc ONLOGON /tn Syncthing /tr "powershell .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 ----- From f710ea272068d882df01f2d280ffea82231e7b77 Mon Sep 17 00:00:00 2001 From: Rafael Ledo Date: Thu, 8 May 2025 02:35:46 -0300 Subject: [PATCH 3/4] docs: fix typo accidentally removed a dot --- users/autostart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/autostart.rst b/users/autostart.rst index 679beefb8..92f5ecd93 100644 --- a/users/autostart.rst +++ b/users/autostart.rst @@ -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 From b063a9597bd556c020d49cfdf30fbf17cbcb3c59 Mon Sep 17 00:00:00 2001 From: Rafael Ledo Date: Tue, 13 May 2025 21:38:08 -0300 Subject: [PATCH 4/4] fix: use more semantic term --- users/autostart.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/users/autostart.rst b/users/autostart.rst index 92f5ecd93..a0178142f 100644 --- a/users/autostart.rst +++ b/users/autostart.rst @@ -252,8 +252,8 @@ 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 -^^^^^^^^^^^^^^ +For Advanced Users +^^^^^^^^^^^^^^^^^^ It's possible to run Windows Task Scheduler CLI API with a command such as ``schtasks /create /sc ONLOGON /tn Syncthing /tr " [--no-console --no-browser]"``.