Complaining Mapped Drive does not exist!!!

Posted on 2006-06-04
Last Modified: 2008-01-09
I used subst command to substitute local folder C:\test\ to a mapped drive Q:
But when ASP page want to access to the Q: drive, it is complaining the drive does not exist.
I had shared out c:\test and given administrator full control of the permission.

Code below showed how i checked on the Q: drive.

Set MyFile = Server.CreateObject("Scripting.FileSystemObject")
If MyFile.driveexists("Q:") then
Response.Write("not exist")
end if

On the IIS setup, i am using administrator as User Name for Anonymous access.

Please advise why the ASP page still unable to access the Q: drive....
Question by:ian_khoo_sc
    LVL 31

    Expert Comment

    ASP runs under IUSR account by default, not administrator.  Set up permissions for IUSR.
    LVL 6

    Expert Comment

    hi, you could try the following which creates the share dynamically

    Set objNetwork = CreateObject("WScript.Network")

    If MyFile.driveexists("Q:") then
    'Disconnect Q drive if it existst
    objNetwork.RemoveNetworkDrive  "Q:" , True

    Response.Write("not exist")
    ' Connect Q drive
    objNetwork.MapNetworkDrive "Q:" , "\\servername\test", "false", "Username", "password"

    end if
    LVL 22

    Accepted Solution

    its better to skip the drive mapping and use the unc path to access the share.  


    mapped drives are user assigned, not system assigned.  you may be able to make it work by signing in as admin and mapping that drive, but its best to use the unc path.
    LVL 15

    Expert Comment

    I agree with WMIF.
    Unless you're using domain users you'll have to duplicate the web server user on the remote server with identical passwords and grant it permissions.

    Author Comment

    We are using domain users, the web server is login using domain/administrator account and i had already given full control for the domain/administrator. However, It is still not working with the mapped drive.

    I will use the unc path mention by WMIF. Thanks for all the contribution from yours...

    Featured Post

    Live: Real-Time Solutions, Start Here

    Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

    Join & Write a Comment

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    755 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

    23 Experts available now in Live!

    Get 1:1 Help Now