Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to define a relative path for 'Start external program' in VS 2010 project?

I know that here there is a similar question but I would like, if possible, to be able to define a relative path for 'Start External Program' or any workaround that do not constrain me to add a complete new empty project to my solution.

I am using VB.NET in Visual Studio 2010 environment developing WinForms apps.

like image 216
Drake Avatar asked Oct 04 '10 14:10

Drake


People also ask

How do you find relative path Vscode?

Relative Path Extension for VS CodePress Ctrl+Shift+H (Mac: Cmd+Shift+H ) and start typing the file you want.

How do I put the file path in Visual Studio?

In Visual Studio, click Tools > Options. Expand Projects and Solutions and click Locations. The Projects location field defines the default location for storing new projects. You can change this path if you are using a different working folder.


2 Answers

While you cannot use project macros like $(SolutionDir) or environment variables for "Start external program:", you can use relative paths as long as a path relative to the solution directory solves your problem. I just tested VS2010 and a VB.NET WinForms project and set "Start external program:" to:

  • ..\..\..\windows\system32\cmd.exe

and then Ctrl+F5 runs a command prompt. Adjust the number of .. elements to the folder depth of your project.

like image 160
Rick Sladkey Avatar answered Oct 23 '22 05:10

Rick Sladkey


You can use project macros, such as $(ProjectDir) and define from there.

See this page

like image 44
James Avatar answered Oct 23 '22 04:10

James