如何将 \\wsl$\ 类型的 UNC 路径映射为 Windows 驱动器盘符?

3
我正在使用Windows上的Eclipse连接到WSL上的文件时,遇到了一个显然是Eclipse bug的问题,即像\wsl$\folder1\pom.xml这样的文件名会被破坏。 建议在bug报告中评论可能有一个解决方法。 https://bugs.eclipse.org/bugs/show_bug.cgi?id=577938
A workaround is to map the UNC path to a drive letter, but this shouldn't be necessary

我该怎么做呢?


https://support.microsoft.com/en-us/windows/map-a-network-drive-in-windows-29ce55d1-34e3-a7e2-4801-131475f9557d - CherryDT
阅读net help use的输出。 - Ben Voigt
这解决了你的问题吗?windows批处理文件错误 - Mo'ath Alshorman
1个回答

6
我用这种方式实现的(j: 磁盘可用)。
net use j: \\wsl$\Ubuntu

请注意,这是持久性的,如果不删除可能会导致wsl2自行重启。完成此操作后,我能够从Windows Emacs访问Ubuntu发行版中的文件。
要删除它:
net use /del j:

同时确保不要使用尾部反斜杠:net use j: \\wsl$\Ubuntu\ 失败。似乎挂载子目录也不起作用。 - cdleonard

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接