>>JUSTPATH(FULLPATH(SYS(16,0))) if you can get at the source. Just chop off the file name and extension. You could use JUSTDRIVE(), but if there are any UNC references, there may not be a drive letter attached.
>
>That works fine, except that I don't have foxtools available in this app (and app is still in vfp5)...there a number of different server installations in this case (and they can't all access a common point), and I'm trying to avoid installing foxtools for this...but maybe I'm out of luck with sys() functions, so I'll have to take one of your suggestions. I guess an API call is simpler than using foxtools, now that I think about it...
>
Try this instead:
cAppStart = FULLPATH(SYS(16,0))
cAppStart = LEFT(cAppStart,RAT('\',cAppStart)-1)
That's the path - you'll need an API call to resolve a mapped drive letter to a UNC if you need to do this.
LPARAMETER cDriveLetterToCheck
LOCAL cBuffer, nResult
cBuffer = SPACE(511)
DECLARE INTEGER WNetGetConnection IN Win32API ;
STRING @cLocalDrive, ;
STRING @cRemoteUNCBuffer, ;
INTEGER @nSizeOfBuffer
nResult = WNetGetConnection(LEFT(cDriveLetterToCheck,2), ;
@cBuffer, ;
511)
IF nResult # 0
RETURN ''
ELSE
RETURN LEFT(cBuffer,AT(CHR(0),cBuffer)-1)
ENDIF
>>
>>If you need to inspect shortcuts, use the WSH Wscript.Shell object's CreateShortcut method to open up the existing shortcut. CreateShortcut returns a shortcut object; the object's TargetPath property will give you the base command line, and the WorkingDirectory property returns the Startup directory for the application.
>
>Thanks, I'll check this out.