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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to check to see if a drive is shared

Status
Not open for further replies.

ugagrad

Programmer
Sep 12, 2003
49
US
Hello,
I have developed a program that shares a users drive for them automatically if they want it to. Right now it always asks the user if they want to share their drive. Even if it is already shared!!!B-(
Does anyone know a clever way to check to see if a specified folder is shared [smarty]
Thanks in advance,
UGAGRAD
 
ugagrad

How about on-mapping it everytime, and if the drive letter is not found catch the error and re-map the drive:
Code:
ON ERROR do remap
WshNetwork = CreateObject("WScript.Network")
WshNetwork.RemoveNetworkDrive("J")
PROCEDURE remap
oNet = CreateObject("WScript.Network")    
oNet.MapNetworkDrive("J","\\SOL\users",.T.)
ENDPROC

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
faq184-4449 Enumerate Available Shares and Current Mapping should be what your looking for.

Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top