windows - 如何在 Windows 10 的命令行中运行路径中包含空格的可执行文件?

标签 windows cmd space

H:\>"H:\Program Files\R\R-3.4.0beta\bin\R.exe"
'H:\Program' is not recognized as an internal or external command,
operable program or batch file.

H:\>"H:\Progra~1\R\R-3.4.0beta\bin\R.exe"
The system cannot find the path specified.

H:\>H:\Progra~1\R\R-3.4.0beta\bin\R.exe
The system cannot find the path specified.

我尝试使用 "..."Progra~1,但两者都无法在 Windows 10 上运行。

我做错了什么?

最佳答案

简答:使用 & 'C:\path with spaces\app.exe'

说明:只需在 powershell 中输入您的路径,并在您选择任何包含空格的目录时使用 TAB 自动完成。 Powershell 将自动插入单引号 'bla bla' 并且它还会在前面放置一个 & ,这是将字符串视为需要的东西应该被执行。像往常一样继续完成您的路径。

关于windows - 如何在 Windows 10 的命令行中运行路径中包含空格的可执行文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43510438/

相关文章:

sql命令占用大量空间

c# - 无法启动应用程序,KernelBase.dll 错误

python - 启动 jupyter notebook 时出现 fatal error

windows - 仅使用批处理文件修剪前导斜线

android - 如何在安卓模拟器上安装应用程序?

Cin 之后的 C++ Getline

html - 在 html 中格式化数字 : adding space between millions (like : 9 999 999)

mysql - 是否可以使用 mongrel 创建delayed_job 作为Windows 服务?

python - 在混合调试中没有为 C++ 加载符号(来自 Python)

c++ - 使用 Win32 执行命令