Link to home
Start Free TrialLog in
Avatar of ian_khoo_sc
ian_khoo_sc

asked on

Complaining Mapped Drive does not exist!!!

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("exist")
else
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....
Thanks
Avatar of alorentz
alorentz
Flag of United States of America image

ASP runs under IUSR account by default, not administrator.  Set up permissions for IUSR.
Avatar of Devil666
Devil666

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

Set objNetwork = CreateObject("WScript.Network")

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

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

end if
ASKER CERTIFIED SOLUTION
Avatar of WMIF
WMIF

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
Avatar of ian_khoo_sc

ASKER

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...