How to get the path to the VS command line prompt (in both 32bit and 64bit)?
Hi,
Up until today, in order to get the VS command line prompt I checked the "ProductDir" value in the "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\9.0\VC" registry key.
I noticed that this code won't necessarily do the job if I'm running on Windows 7 64 bit, since this key is not always accissible to all programs.
I started to read a little about "WOW64", registry redirection, and registry reflection, but to verify that I'm not doing some kludgy Quick & Dirty work I wanted to ask: Is there a C# code to get the full path to the VS command-line prompt which is not dependent on the Windows version (XP, Vista, Server, or Windows 7), and not depend on whether we're in 32bit or 64bit?
Re: How to get the path to the VS command line prompt (in both 32bit and 64bit)?
The CMD prompt will not be what you expect, as it is not the logged on user running your program on Vista+ Really depends on what you need to do with the info?
The ENVIRON variables might help
Last edited by dglienna; October 24th, 2010 at 09:53 PM.
Re: How to get the path to the VS command line prompt (in both 32bit and 64bit)?
Sorry, but I didn't understand how this answer my question:
How to programmatically get the path to the Visual Studoi command line prompt - a C# code which will work for .NET programs compiled with "Any CPU" platform, and that will run on both 32bit and 64bit?
Re: How to get the path to the VS command line prompt (in both 32bit and 64bit)?
Originally Posted by Trinominal
Sorry, but I didn't understand how this answer my question:
How to programmatically get the path to the Visual Studoi command line prompt - a C# code which will work for .NET programs compiled with "Any CPU" platform, and that will run on both 32bit and 64bit?
Regards
If you let us know why you need this path, we might be able to help further.
Bookmarks