Solved

Login Script Drive Mapping Issue

Posted on 2012-03-21
4
341 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
  • 3
4 Comments
 
LVL 30

Accepted Solution

by:
IanTh earned 500 total points
Comment Utility
0
 
LVL 30

Expert Comment

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

Author Comment

by:wantabe2
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Batch, VBS, and scripts in general are incredibly useful for repetitive tasks.  Some tasks can take a while to complete and it can be annoying to check back only to discover that your script finished 5 minutes ago.  Some scripts may complete nearly …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now