Results 1 to 2 of 2

Thread: Best way to check network directories

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Posts
    5
    What would be the best kind of module to run when a program boots up to check that there are permissions in place for a user to access a drive on a server. We don't want the drive mapped so don't go that route.

    I also want it to happen within the Form_Load() sub.

    Since the program will be replacing a file in a network directory, i was thinking of killing two birds with one stone by moving the old file (for backup purposes) to a different directory, and then putting the new one in its place when the program is run. If I can't move the existing files, then permissions aren't in place, and an error is returned.

    Is this the best way to do it, and if so, how would I code the move statements?

    Thanks,

    A

  2. #2
    Lively Member Ianf's Avatar
    Join Date
    Mar 2000
    Location
    Leigh, Lancashire, UK
    Posts
    96

    Post This might not seem that usefull

    What you need is ADSI downloadable from Microsofts web site.
    With ADSI you can look at a network like a directory you can create new users look at user permissions etc.

    The following code shows how you could map all the PC's and the users profiles set on the PCs that are on a Domain

    Set WshNetwork = CreateObject("WScript.Network")
    Set WshGroups = CreateObject("Scripting.Dictionary")
    WshGroups.CompareMode=vbTextCompare

    DomName = WshNetwork.UserDomain
    Set DomComp = GetObject("WinNT://" & DomName)
    DomComp.filter = Array("computer")

    For each Computer in DomComp

    msgbox Computer.Name
    Set ComputerLogon = GetObject("WinNT://" & DomName & "/" & Computer.Name)
    ComputerLogon.filter = Array("user")

    For each User in ComputerLogon

    msgbox Computer.Name & "-" & User.Name

    Next

    Next

    There is lots of information available on this subject

    Hope this helps
    Ian Frawley
    Software Engineer
    E-mail [email protected]

    BEING IN THERAPY
    And yet, having therapy is very much like making love to a beautiful woman. You... get on the couch, string 'em along with some half-lies and evasions, probe some deep dark holes, and then hand over all your money.

Posting Permissions

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



Click Here to Expand Forum to Full Width