Click here to Skip to main content
15,887,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
private void btnReport_Click(object sender, EventArgs e)
        {
            Process openVisualStudio2008 = new Process();
            openVisualStudio2008.StartInfo.FileName = @"C:\Program Files(x86)\Microsoft Visual     Studio 9.0\Common7\IDE\devenv.exe";
            openVisualStudio2008.Start();
        }


How can I specify the filename correctly, because if I change the Filename to

private void btnReport_Click(object sender, EventArgs e)
        {
            Process openVisualStudio2008 = new Process();
            openVisualStudio2008.StartInfo.FileName = "devenv.exe";
            openVisualStudio2008.Start();
        }


it starts Visual Studio 2012.exe and im looking for VS2008.exe to start. The reason for all this is that I need to open a report which only seems to work in VS2008
Posted
Comments
Jochen Arndt 8-May-13 3:41am    
You must escape back slashes in strings with another backslash:
openVisualStudio2008.StartInfo.FileName = "C:\\Program Files(x86)\\Microsoft Visual Studio 9.0\\Common7\\IDE\\devenv.exe";

private void btnReport_Click(object sender, EventArgs e)
        {
            Process openVisualStudio2008 = new Process();
            openVisualStudio2008.StartInfo.FileName = @"C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe";
            openVisualStudio2008.Start();
        }


I managed to get it working with the code above. Browsed to the exe then copies the path and pasted into my code.

Problem number 2. How will I get it to open a specific file now in the VS 2008 automatically?
 
Share this answer
 
I managed to get it working with the code above. Browsed to the exe then copies the path and pasted into my code.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900