It would work if application is run as standalone EXE. If yiou're running your application from within VFP than you've to dig thru program stack. Something like
lnlevel = 2
lcExeName = ""
DO WHILE NOT EMPTY(SYS(16,lnlevel))
IF RIGHT( UPPER( SYS(16,lnlevel)), 4) = ".EXE"
lcExeName = SYS(16,lnlevel)
ENDIF
lnlevel = lnlevel + 1
ENDDO
>Both of those commands show "vfp.exe". I guess I did not say it right, I need the application executable name, like: payroll.exe or genSrvcs.exe.
>
>>>Is there any way to capture the name of the executable while the app is running. I want to use a variable for that name to use in the newobject function oObj=newobject(class,parentclass,sExe), where sExe=executablename.
>>>
>>>Thanks
>>
>>
lcExeName = SYS(16,1)
>>* or
>>lcExeName = _vfp.ServerName
--sb--