我想从命令行运行一个特定的应用程序(让我们称之为foo),但我不希望它阻止终端,将任何来自其输出或错误流的垃圾放入终端,并且还希望它保持即使我关闭所述终端也能运行。在 Bash 中,我可以使用 来做到这一点(foo &>/dev/null &),但我不知道如何在 Windows shell 中做到这一点。有人可以帮我吗?
我通过输入命令的路径来尝试命令,当我点击 时TAB,发生了这种情况:
C:\> C:\Program Files\KeePassXC\keepass<TAB>
# became this:
C:\> & 'C:\Program Files\KeePassXC\keepassxc-cli.exe'
Run Code Online (Sandbox Code Playgroud)
它只是评估一个字符串吗?至少,我认为是这样,因为路径需要用引号括起来,因为其中有空格,并且不会&出现以下错误:
C:\> 'C:\Program Files\KeePassXC\keepassxc-cli.exe' --help
At line:1 char:50
+ 'C:\Program Files\KeePassXC\keepassxc-cli.exe' --help
+ ~~~~
Unexpected token 'help' in expression or statement.
At line:1 char:1
+ 'C:\Program Files\KeePassXC\keepassxc-cli.exe' --help
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The '--' operator works only on variables or on properties.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnexpectedToken
Run Code Online (Sandbox Code Playgroud)
您能链接到文档吗?谢谢你!