Santosh
Santosh

Reputation: 127

Load my WPF Window application using command prompt

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?

Upvotes: 0

Views: 264

Answers (2)

lc.
lc.

Reputation: 116528

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#?.

Upvotes: 1

BizApps
BizApps

Reputation: 6130

Check this thread:

Run Windows application from Command Prompt

Regards

Upvotes: 0

Related Questions