Map a network drive thats protected

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jarremw
    New Member
    • Jan 2008
    • 50

    Map a network drive thats protected

    hello all
    i am trying to map a network drive when my program starts, what i want to do is run an if statement to check if the drive is mapped or not, if it is not then i want to have the program map it, its protected so i need to include user and pass, any help please!!!

    thanks in advance!!
  • jarremw
    New Member
    • Jan 2008
    • 50

    #2
    ok i found it.....here it is, i just used the windows script host object model
    heres how
    i made a reference to it in the add reference dialog
    then to set the drive to be mapped i just used

    Dim connect As IWshRuntimeLibr ary.WshNetwork

    connect = New IWshRuntimeLibr ary.WshNetwork
    connect.MapNetw orkDrive("drive you want in string format", "localname and share", False, "username", "password")
    connect = Nothing
    so there it is....

    Comment

    Working...