Avatar of Rajkumar Gs
Rajkumar Gs
Flag for India asked on

How get current path of exe in windows services

Hi,
 I am using windows serives. I have one windows application. Now i call the exe of this application in windows service using System.Diagnostic.Process.Start(exepath). It is working fine. But i have the problem that in windows application i get the values from ini file using current directory path that Application.startupPath(exename).

I can get the values from ini file when run windows app alone. But i put the exe to services i can't get the value. Because the current directory path shows in services that C://Windows/System32. So i put the ini file in the path. It is working fine when run the services and get the values.

But i dont want to do that every time put the file in the system32 path. I put the file in windows service path when create setup. so i want to get the values from the services directory path. How can we achieve this scenario? I believe that you catch my point that what i am telling here. Hope expecting your reply.

Thanks
.NET ProgrammingVisual C++.NETVisual Basic.NET

Avatar of undefined
Last Comment
Rajkumar Gs

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
s_chilkury

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
rajeshrolen

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Rajkumar Gs

ASKER
Hi Reajesh

 Thanks for your reply. I will try to execute the above one in my code and let you know.

Thanks
Rajkumar Gs

ASKER
Thanks.
I got similar solution from here as well.
http://stackoverflow.com/questions/199961/getting-full-path-for-windows-service

Raj
Rajkumar Gs

ASKER
Thank you
Raj
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy