DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Help - Problem with login script

  1. #1
    Join Date
    Feb 2005
    Posts
    7

    Help - Problem with login script

    Hi,

    I am having troubles with running this script

    Const Printer_Mapping = "cn=U-MAP-P-Server-Share"
    Const Map_X_Drive = "cn=U-MAP-D-Server-Share-X"
    Const Printer_Mapping_Default = "cn=U-MAP-P-Server-Share"

    Set wshNetwork = CreateObject("WScript.Network")
    wshNetwork.MapNetworkDrive "h:", "\\osys13\Ondemand\" & wshNetwork.UserName

    Set ADSysInfo = CreateObject("ADSystemInfo")
    Set CurrentUser = GetObject("LDAP://" & ADSysInfo.UserName)
    strGroups = LCase(Join(CurrentUser.MemberOf))

    If InStr(strGroups, Printer_Mapping) Then

    wshNetwork.AddWindowsPrinterConnection "\\L-CBSPRN01\L-CBSP001"

    ElseIf InStr(strGroups, Printer_Mapping_Default) Then

    wshNetwork.AddWindowsPrinterConnection "\\L-CBSPRN01\L-CBSP002"
    wshNetWork.SetDefaultPrinter "\\L-CBSPRN01\L-CBSP002"

    ElseIf InStr(strGroups, Map_X_Drive) Then

    wshNetwork.MapNetworkDrive "g:", "\\osys10\jetforms\"

    End If


    An error message comes up saying

    Line: 13
    Char: 1
    Error:Type mismatch: 'join'
    Code: 800A000D
    Sourc: M$ VBscript Runtime error

    Unfortunely this is a sample script so i have no idea what is wrong with it Can someone please tell me what is wrong with it?

    Thanks

    Aaron

  2. #2
    Join Date
    Dec 2003
    Posts
    2,750
    The code looks OK to me. Does it make any difference if you dimension (Dim) strGroups?
    Paul
    ~~~~
    Microsoft MVP (Visual Basic)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center