0

When we type "Notepad" in "Windows > Run" the Notepad is launched.

In the same way, I would like to load my WPF window Application when a user types the program name in "Windows > RUN" or in command prompt(cmd).

What should I do to make this happen?

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Santosh
  • 127
  • 2
  • 12

2 Answers2

1

The reason simply typing notepad works, and you are not required to type the full path of C:\Windows\notepad is because C:\Windows\ is in the PATH environment variable.

Therefore, in order for Windows to be able to find your program when you type myProgram, and not require your users to type C:\Program Files\myProgram\myProgram, the program's location must be in the PATH environment variable.

To do this from code in an install program, see How do I get and set Environment variables in C#?.

Community
  • 1
  • 1
lc.
  • 113,939
  • 20
  • 158
  • 187
  • I want to add Environment variables when my application is installing. I am using Visual Studio 2010 Setup. – Santosh Mar 07 '13 at 06:28
0

Check this thread:

Run Windows application from Command Prompt

Regards

BizApps
  • 6,048
  • 9
  • 40
  • 62