简体   繁体   中英

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?

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

Check this thread:

Run Windows application from Command Prompt

Regards

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM