-
Notifications
You must be signed in to change notification settings - Fork 567
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
Closed
Closed
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
893167c
docs: add more context to Windows execution
rafaeloledo 8a2f21a
docs: adopt suggestions from tomasz1986
rafaeloledo f710ea2
docs: fix typo
rafaeloledo b063a95
fix: use more semantic term
rafaeloledo 893ace5
Merge branch 'syncthing:main' into main
rafaeloledo e1ef970
Merge branch 'main' into main
rafaeloledo 8222784
chore: adjust from the last review
rafaeloledo 1064409
fix: make -File mandatory
rafaeloledo 0e6f217
fix: treat -FilePath as mandatory
rafaeloledo 3eb4614
chore: unclutter information
rafaeloledo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your schtasks example includes
--no-console --no-browser
but yourPowershell example doesn't. Perhaps it should, so the two examples mirror each other?
Also, isn't
-File
required? So:powershell -File <path to script>.ps1
?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://forum.syncthing.net/t/win-10-and-11-updates-breaks-no-console/19142
I was trying the
--no-console
flag that only exists in theWindows
version of thesyncthing
and faced some issues related.Switching to the mentioned
legacy mode
may be discouraged, sinceWindows Terminal
is being a default on all new installations.Wrapping with a
ps1
script works even onwt.exe
pop-ups.-File/-FilePath
is not mandatory.https://learn.microsoft.com/pt-br/powershell/module/microsoft.powershell.management/start-process?view=powershell-7.5
https://learn.microsoft.com/pt-br/powershell/module/microsoft.powershell.management/start-process?view=powershell-5.1
If you give the path as a first argument, it assumes that is the -FilePath flag as you can see above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might also try
conhost.exe --headless ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've not tested it. Feel free to contribute and do it. I don't have Windows installation on my PC right now...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't referring to
Start-Process
but to the powershell command itself:powershell -File "<path to script>.ps1"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It still works without
-File
, but I'm not sure if it implicitly defaults to-File script.ps1
or rather-Command script.ps1
🙃.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not on my system:

If you want to skip the -File option, you need to use:
powershell .\script.ps1
.Better to just tell our readers to use the option, as
<path to script>
is vague, imho.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately @rasa example is what happening in my system too.
So, the
-File
flag is mandatory in this case.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can only find docs offline about
powershell.exe
. But, as you can see, even if it is treated as optional, you'll need to use thedot operator
to resolve file paths. Using-File
directly can be more user friendly considering that the operator is less known by non programmers.