Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

My application uses openvpn.exe. System may have openvpn already in it and also saved to its path. I want my app to forcibly use the file that is in the application folder only.

In app, if I use "openvpn --...." it uses the file that is located in Path. I wan to use the file that I have in my dir only. How do I achieve it?

Any help is highly appreciated. Thanks.
Posted

1 solution

This could be done by providing the full path to the executable that you want to refer to. So instead of "openvpn" you could say "C:\Program Files\YourApp\openvpn".
 
Share this answer
 
v2
Comments
All Time Programming 10-Feb-11 4:12am    
tHANKS jf2015, I tried with Enviornment.CurrentDirectory + "\\openvpn...." . This should work with all cases I think so. Am I right or wrong ?
JF2015 10-Feb-11 4:24am    
Yes that is the correct way to approach this kind of problem. Environment.CurrentDirectory will help you if the openvpn.exe you want to access is in the folder of your programs executable.
Nuri Ismail 10-Feb-11 4:31am    
Good answer. 5+

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