Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting network drive
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00199194
Message ID:
00199263
Views:
15
>>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.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform