?
Solved

Login Script Drive Mapping Issue

Posted on 2012-03-21
4
Medium Priority
?
355 Views
Last Modified: 2012-03-22
I have the following code in my login script:

If (IsMember(objUser, "Office Users") = True) Then
    On Error Resume Next
    objNetwork.MapNetworkDrive "g:", "\\165.123.32.3\share"
    If (Err.Number <> 0) Then
        On Error GoTo 0
        objNetwork.RemoveNetworkDrive "g:", True, True
        objNetwork.MapNetworkDrive "g:", "\\165.123.32.3\share"
    End If
    On Error GoTo 0
End If

Open in new window


It is supposed to map drive G: but I am prompted for a username & password if I run the script manually. How can I embed the username & password for to access this drive inside the code I have listed above?
0
Comment
Question by:wantabe2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 30

Accepted Solution

by:
IanTh earned 1500 total points
ID: 37748887
0
 
LVL 30

Expert Comment

by:IanTh
ID: 37748895
but cant you add office to \\165.123.32.3\share permissions ?
0
 
LVL 15

Author Comment

by:wantabe2
ID: 37748957
So it would look like this? I can't test it at this time but will in about 2 or 3 hours...


If (IsMember(objUser, "Office Users") = True) Then
    On Error Resume Next
    objNetwork.MapNetworkDrive "g:", "\\165.123.32.3\share"
    If (Err.Number <> 0) Then
        On Error GoTo 0
        objNetwork.RemoveNetworkDrive "g:", True, True
        objNetwork.MapNetworkDrive "g:", "\\165.123.32.3\share"
        strUser = theusername
        strPassword = thepassword
    End If
    On Error GoTo 0
End If

Open in new window

0
 
LVL 30

Expert Comment

by:IanTh
ID: 37751660
yes but I said why does it require the user and password in the script it suggests that the office permissions are not on the share
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question