Win7下如何获取虚拟机文件夹?

发布于 2024-08-29 13:47:18 字数 343 浏览 3 评论 0原文

我正在编写一个名为 XP-More 的工具,它应该有助于管理 Windows 7 虚拟机。该工具启动后要做的第一件事就是找到 VM 文件夹。但是,事实证明该文件夹未列为 Windows 特殊文件夹。我使用了一种解决方法,但它不可靠。理想情况下,

Environment.GetFolderPath(Environment.SpecialFolder.VMFolder)

或者这样就可以完成这项工作,但 VMFolder 是我的想象的虚构。有没有真正的方法来获取该文件夹?

I'm writing a tool called XP-More, which should help manage Windows 7 Virtual Machines. The first thing the tool has to do when launched is find the VM folder. However, turns out that folder is not listed as a Windows Special Folder. I use a workaround, but it's unreliable. Ideally,

Environment.GetFolderPath(Environment.SpecialFolder.VMFolder)

or so would have done the job, but VMFolder is a fiction of my imagination. Is there any real way to get that folder?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

月棠 2024-09-05 13:47:18

我找到了这个。您可以获取默认文件夹,也可以搜索“myvirtualmachines”环境变量。

I found this. You can either get the default folder, or search for the 'myvirtualmachines' environment variable.

感情洁癖 2024-09-05 13:47:18

@m0sa - 您的解决方案适用于 Microsoft Virtual PC,但 Windows 7 附带了一个名为 Windows Virtual PC 的变体,它似乎略有不同。例如,在我的 Windows 7 上,既没有 myvirtualmachines 环境变量,也没有任何其他环境变量指向实际文件夹。

(很抱歉写这个作为答案。我知道这很糟糕,但目前我无法添加评论)

@m0sa - your solution works for Microsoft Virtual PC, but Windows 7 comes with a variant called Windows Virtual PC, which seems to be slightly different. On my Windows 7, for instance, there's neither myvirtualmachines environment variable nor any other one pointing to the actual folder.

(sorry for writing this as an answer. I know it sucks, but I can't add comments at this point)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文