Sharing a folder in VB6
Results 1 to 2 of 2

Thread: Sharing a folder in VB6

  1. #1
    Registered User
    Join Date
    Apr 2001
    Location
    Mexico
    Posts
    19

    Question Sharing a folder in VB6

    Hello,
    lets say i have a folder ( c:\myfolder")
    is there any way to make it a network shared folder FROM CODE?
    i found that windows stores info of shared folder on the registry under "HKEY_LOCAL_MACHINE\Software\Microsoft\
    Windows\CurrentVersion\Network\LanMan"
    however if i add a new subkey to it (with myfolder info) it just doesnt work.
    itīs driving me nutz! please help.
    "Dumb Is not the One who does not know, But the one that does not know AND DOES NOT ASK!"

  2. #2
    Registered User
    Join Date
    Jan 1999
    Location
    London, Great Britain
    Posts
    300

    Thumbs up

    I would write you a correct reply, but then someone like Scottie may come along and have a go at me because they can do it differently, or can list more websites they've looked at or something.

    Either that, or I should just make you pay for something that I found by doing a search on the internet, *cough*WinDrivers*cough*

    Ah well, better stop teasing or the Admins will come and get me

    To map a network drive in VB, you need to use the "Active Directory Services Interface" (ADSI) library (tick it through Project -> References -> "Active DS Type Library") and then use the IADsFileShare object to create new shares.

    There's an example at the <a href="http://support.microsoft.com/support/kb/articles/Q169/3/98.asp" target="_blank">Microsoft MSDN Site</a> which shows you how to enumerate through local shares as well as create your own.

    It also gives you links to download ADSI if you don't already have it installed (you probably don't!)

    HTH,
    I'd rather die peacefully in my sleep like my Grandfather,
    than screaming in terror like his passengers.
    Jim Harkins
    <a href="http://www.Horrible.Demon.co.uk/" target="_blank">http://www.Horrible.Demon.co.uk/</a>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •