views:

76

answers:

2

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?

+2  A: 

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

m0sa
+1  A: 

@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)

xpmore