[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Login Script Drive Mapping Issue

Posted on 2012-03-21
4
Medium Priority
?
356 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Suggested Courses

656 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