but would like it to start using a predefined command, which would be
DISM /Online /Get-FeatureInfo /FeatureName:Recall
I tried just adding that command, but the window just closes. Maybe there is a trick? I am posting it here, because it's mainly about the Powershell syntax.
PowerShell.exe /? will tell you the arguments you can use to run PowerShell.
They include these, which should let you do what you need:
-NoExit
Does not exit after running startup commands.
-Command
Executes the specified commands (and any parameters) as though they were
typed at the Windows PowerShell command prompt, and then exits, unless
NoExit is specified. The value of Command can be "-", a string. or a
script block.
If the value of Command is "-", the command text is read from standard
input.
If the value of Command is a script block, the script block must be enclosed
in braces ({}). You can specify a script block only when running PowerShell.exe
in Windows PowerShell. The results of the script block are returned to the
parent shell as deserialized XML objects, not live objects.
If the value of Command is a string, Command must be the last parameter
in the command , because any characters typed after the command are
interpreted as the command arguments.
To write a string that runs a Windows PowerShell command, use the format:
"& {<command>}"
where the quotation marks indicate a string and the invoke operator (&)
causes the command to be executed.
In powershell you can run regular executables as well of course, just like you can run "notepad.exe" in powershell or in a regular command prompt (cmd.exe). So, that's why running "dism.exe" works, it's a regular executable file somewhere in your PATH, but it's not related to powershell in any specific way.
This works, as you found out.. powershell -noexit -command dism ..
..but you probably get the same result (terminal window staying open) if you use an "MS-DOS Batch Function" type button and this code:
For more tweaks and disabling some more unwanted Windows Features, I think the Chris Titus WinUtil is worth mentioning here. It has a ton of options and convenience-clicks..
Make sure the window is big enough to see all the options or use of the scroll bar to the right, which can easily be overlooked, it is a bit too dark and slim for my taste to be recognized easily.
Thanks, i could test that too. I need it to check if that function stays disabled after Win updates. Not sure about how to use WinUtil, i only found that ps1 script, no installer.. Ok, got it.