From 893167c49d85aa96f72a3ac53ead1b4489f19b5f Mon Sep 17 00:00:00 2001 From: Rafael Ledo Date: Wed, 7 May 2025 02:52:41 -0300 Subject: [PATCH 1/8] 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/8] 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/8] 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/8] 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]"``. From 8222784637b4cbac9e32039397969231dae4b1cd Mon Sep 17 00:00:00 2001 From: Rafael Ledo Date: Sun, 31 Aug 2025 03:29:27 -0300 Subject: [PATCH 5/8] chore: adjust from the last review --- users/autostart.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/users/autostart.rst b/users/autostart.rst index a0178142f..8042de655 100644 --- a/users/autostart.rst +++ b/users/autostart.rst @@ -252,17 +252,17 @@ 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 Advanced Users -^^^^^^^^^^^^^^^^^^ +CLI and Native Solutions for Terminal Users +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -It's possible to run Windows Task Scheduler CLI API with a command such as +It's possible to run Windows Task Scheduler native 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. +The operation requires elevated privileges. If you're facing issues when using ``--no-console``, you can +try wrapping the executable with a ``PowerShell`` script. ``script.ps1``:: - Start-Process ".exe" -WindowStyle Hidden + Start-Process [-FilePath] ".exe" [-ArgumentList "..."] -WindowStyle Hidden Then run as admin:: From 106440995afe804c931d381104ff13c418788d04 Mon Sep 17 00:00:00 2001 From: Rafael Ledo Date: Sun, 31 Aug 2025 18:21:03 -0300 Subject: [PATCH 6/8] fix: make -File mandatory --- users/autostart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/autostart.rst b/users/autostart.rst index 8042de655..28917d9a9 100644 --- a/users/autostart.rst +++ b/users/autostart.rst @@ -266,7 +266,7 @@ try wrapping the executable with a ``PowerShell`` script. Then run as admin:: - schtasks /create /sc ONLOGON /tn Syncthing /tr "powershell .ps1" + schtasks /create /sc ONLOGON /tn Syncthing /tr "powershell -File C:\\path\\to\\script.ps1" For more information, please read official docs for Command Line Interface API: From 0e6f2178d3b5338ee41d5121617abc3bc60808e2 Mon Sep 17 00:00:00 2001 From: Rafael Ledo Date: Sun, 31 Aug 2025 18:32:03 -0300 Subject: [PATCH 7/8] fix: treat -FilePath as mandatory --- users/autostart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/autostart.rst b/users/autostart.rst index 28917d9a9..8b69cb1f0 100644 --- a/users/autostart.rst +++ b/users/autostart.rst @@ -262,7 +262,7 @@ try wrapping the executable with a ``PowerShell`` script. ``script.ps1``:: - Start-Process [-FilePath] ".exe" [-ArgumentList "..."] -WindowStyle Hidden + Start-Process -FilePath ".exe" [-ArgumentList "--no-browser"] -WindowStyle Hidden Then run as admin:: From 3eb46145a0020dd9142677ff6f609a57b1928b26 Mon Sep 17 00:00:00 2001 From: Rafael Ledo Date: Sun, 31 Aug 2025 19:27:08 -0300 Subject: [PATCH 8/8] chore: unclutter information --- users/autostart.rst | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/users/autostart.rst b/users/autostart.rst index 8b69cb1f0..380857c8c 100644 --- a/users/autostart.rst +++ b/users/autostart.rst @@ -255,22 +255,8 @@ by a sysadmin who knows enough to understand the security implications. CLI and Native Solutions for Terminal Users ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -It's possible to run Windows Task Scheduler native CLI API with a command such as -``schtasks /create /sc ONLOGON /tn Syncthing /tr " [--no-console --no-browser]"``. -The operation requires elevated privileges. If you're facing issues when using ``--no-console``, you can -try wrapping the executable with a ``PowerShell`` script. - -``script.ps1``:: - - Start-Process -FilePath ".exe" [-ArgumentList "--no-browser"] -WindowStyle Hidden - -Then run as admin:: - - schtasks /create /sc ONLOGON /tn Syncthing /tr "powershell -File C:\\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 +It's possible to run Windows Task Scheduler native CLI API, for more information, please read +official docs: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/schtasks. macOS -----