Darcy Power
Darcy Power

Reputation: 313

Is there a way to find out the location that the executable file is being run from during runtime?

I am attempting to create a program that places a copy of itself into the windows start-up folder. if the program is being run from anywhere that isn't the start-up folder, I would like the program to add the users username to a text file where the original .exe is. hence I need a way to tell where the program is being run from. is there any inbuilt functions in the default units or will I have to write my own function? if so how would I accomplish this?

Upvotes: 0

Views: 190

Answers (1)

LU RD
LU RD

Reputation: 34899

ParamStr(0) will get you the full path and application name.

Disclaimer: This could be invalid for some OS implementations.

Upvotes: 1

Related Questions