Exe Name

Everything else that doesn't fall into one of the other PB categories.
gamecoders
User
User
Posts: 13
Joined: Wed May 28, 2003 2:41 pm
Location: Italy

Exe Name

Post by gamecoders »

exists a method in order to gain the name of the exe at runtime?
Froggerprogger
Enthusiast
Enthusiast
Posts: 423
Joined: Fri Apr 25, 2003 5:22 pm
Contact:

Post by Froggerprogger »

I think you are searching for the WinAPI-Call GetModuleFileName_() ?

Code: Select all

filename.s = Space(1000)
GetModuleFileName_(0,filename.s,1000)
Debug filename
%1>>1+1*1/1-1!1|1&1<<$1=1
gamecoders
User
User
Posts: 13
Joined: Wed May 28, 2003 2:41 pm
Location: Italy

Post by gamecoders »

I did not think was one inner function
thx for help
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> filename.s = Space(1000)
> GetModuleFileName_(0,filename.s,1000)

Don't forget that the above returns the full path and exe name, and not
just the exe name alone; so use GetFilePart if you want just the exe name.
Post Reply