[英]Open file with spaces in filename using Ubuntu for Windows (WSL) - cmd.exe
我正在使用安装了Ubuntu应用程序(WSL)的Windows 10 Fall Creator's Update(版本1703),该应用程序可以使用cmd.exe /C start ""
本地启动Windows程序。
我的目标是使用文件的默认Windows应用程序在/mnt/d
打开文件。
多数情况下,它对我有用,但当我要打开带有空格的文件名时除外。 在那种情况下,它只打开cmd.exe
窗口并在文件所属的等效Windows目录路径中提示。 它不会在默认应用程序中打开文件。
举例来说,如果我有文件courses.py
并a file name with spaces.py
中/mnt/d/files
cmd.exe /C start courses.py
courses.py
在VS Code中打开courses.py
。
cmd.exe /C start a\\ file\\ name\\ with\\ spaces.py
-在D:\\files
提示符下打开cmd.exe
我在WSL中错误地提供了文件名吗?
@Compo在评论中提供了解决方案:
cmd.exe /C start "" "a\\ file\\ name\\ with\\ spaces.py"
由于我使用wsl-terminal ,因此通过使用以下简洁的内置命令克服了这个问题:
cmdtool wstartex <file|url>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.