#Delete Folder the executeable is in

12 messages · Page 1 of 1 (latest)

potent lodge
#

but, softwares are usually installed under root or anywhere that require administrative access, like C drive in windows.

vast parcel
#

yea but how do I get the path

potent lodge
#

os.Args[0] is path to the binary.

vast parcel
#

so if I have it like that
/root/program/main
it return
/root/program/

potent lodge
#

try it

vast parcel
#

yep

#

tysm

wanton idol
#

this won't work

#

this only will work assuming that the executable being ran is not in your PATH