Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Script a network connection
Message
From
27/12/2000 03:16:30
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00456955
Message ID:
00456991
Views:
20
Can you use:
- the WCONN... Functions in win32api.
- SUBST
- NET USE

Example:
DECLARE INTEGER WNetCancelConnection IN Win32API STRING, INTEGER
IF WNetCancelConnection(cDriveLetter, 1) != 0	
&& 1: disconnect by force even if any file open
nDType = 3									&& if fail to disconnect because the folder was *Substed*
ENDIF

IF nDType = 3			&& local hard disks, including *Substed* drives
	cMapCmd = "subst /d " + cDriveLetter + " > nul"
	RUN &cMapCmd
ENDIF

IF cDriveType = "NET"
	cMapCmd = "net use " + cDriveLetter + " " + cDrivePath + " > nul"
ELSE			&& regarded as "Local", do a subst instead
        cMapCmd = "subst " + cDriveLetter + " " + cDrivePath + " > nul"
ENDIF
RUN &cMapCmd
Cheers!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform