Solved

Login Script Drive Mapping Issue

Posted on 2012-03-21
4
345 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
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
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 …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

770 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