Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Computer name
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00771063
Message ID:
00771088
Views:
8
(1) Get full path for the executable
Use SYS(16) or GetModuleFileName WinAPI function:
DECLARE INTEGER GetModuleFileName IN kernel32; 
	INTEGER  hModule,; 
	STRING @ lpFilename,; 
	INTEGER  nSize
e.g.: z:\app.exe

(2) Find if the executable is located on a remote drive
Use GetDriveType WinAPI function:
#DEFINE DRIVE_REMOTE  4
DECLARE INTEGER GetDriveType IN kernel32;
	STRING RootPath
(3) If the drive is not remote -- then SYS(0) is your answer.

(4) For a remote drive find name of the associated network resource
Use WNetGetConnection WinAPI function:
DECLARE INTEGER WNetGetConnection IN mpr;
	STRING    lpLocalName,;
	STRING  @ lpRemoteName,;
	INTEGER @ lpnLen
e.g.: \\myserver\group1
"myserver" is a computer name you are looking for
Previous
Reply
Map
View

Click here to load this message in the networking platform