Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browse Network and map a selected resouce

Status
Not open for further replies.

DannC

Programmer
Apr 5, 2001
75
RO
oShell = createobject("Shell.Application")
oFolder = oShell.BrowseForFolder(0, "Select directory: ", 0 )

Declare INTEGER WNetAddConnection IN "mpr.dll" ;
STRING cRemoteName, ;
STRING cPassword, ;
STRING cLocalName


Do case
Case vartype(oFolder)="O"

If vartype(oFolder.Items.Item)="O"

If vartype(oFolder.Items.Item.path)="C"

cResource = oFolder.Items.Item.path
cPassword = ""
cDriveLetter = getNextDrive()+":"

if WNetAddConnection(cResource, cPassword,
cDriveLetter) =0
messagebox("Connection succesfull !!",0+64,"Confirm ..")
else
messagebox("Unable to connect !!",0+16,"Confirm ..")
endi
Endi
Endi
Endcase





Function getNextDrive()

For k=68 to 90
If driveType(chr(k))=1
Retu chr(k)
Endi
Endf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top