Determine file name of my own exe

Just starting out? Need help? Post your questions and find answers here.
hth
User
User
Posts: 41
Joined: Tue Aug 21, 2007 8:01 pm

Determine file name of my own exe

Post by hth »

I want to determine the file name of my own actual exe.

With the directory it is no problem (GetCurrentDirectory())

hth
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Determine file name of my own exe

Post by Trond »

hth wrote:I want to determine the file name of my own actual exe.
With the directory it is no problem (GetCurrentDirectory())
GetCurrentDirectory() does not always return the directory of your exe. I don't know why you think it does.

Code: Select all

Debug ProgramFilename() ; Directory and filename
Debug GetPathPart(ProgramFilename()) ; Directory
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Determine file name of my own exe

Post by ts-soft »

Code: Select all

Debug GetFilePart(ProgramFilename())
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Post Reply