Click here to Skip to main content
15,886,518 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Create the application which can be used anywhere by just calling the exe of that application.The process.start() but in that we need to give the file path which going to use.My focus is to get the application run anywhere by calling the exe.

What I have tried:

I have tried the process.start() but in that we need to give the file path which going to use.
Posted
Updated 7-Sep-22 20:44pm

1 solution

Basically, you probably can't - Windows searches a specific set of folders (including the current folder) when you tell it to run an application. These are located in the %path% Windows command variable, plus a couple of other folders: https://stackoverflow.com/questions/27382626/where-is-start-searching-for-executables[^]

And unless the application.EXE file is located in a folder that Windows searches then the only way to run it is to provide a path to it.

The best way to get round this would be to store the path to the EXE in a UserData folder (Where Should I Store My Data?[^] may help - the VB code is very similar) that your app sets on installation, and your other app can access to get the full path when you want to execute it.
 
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