12-04-2022, 11:36 PM
Only one 32-bit long integer variable is necessary:
Code: (Select All)
Function ExePath$
Dim As Long t1
t1 = _InStrRev(Command$(0), "\")
if t1 = 0 then
t1 = _InStrRev(Command$(0), "/")
end if
ExePath$ = Left$(Command$(0), t1 - 1)
End Function