Link to home
Start Free TrialLog in
Avatar of ltyao
ltyao

asked on

How to mapnetworkdrive in ASP?

Hello experts:
 
        I would like to develop login webpage by using asp. After user login, this application actomatically mapnetworkdrive for them. I had one window based login application, that developed by VB Script. It works very well, no any problem. When I develop one simple login interface, just copy the vbscript to that program. Unfortunately, it tells me "WSHNetwork.RemoveNetworkdrive (0x800708CA) This network connection doesn't exist". Does someone know how to solve the problem? Thanks in advance!
Avatar of jitganguly
jitganguly

Most probably permission issue. Does IUSR_{yourservername} user has permission to remove network drive ?
Avatar of ltyao

ASKER

I run the page on localhost, how to know if I have permission to remove networkdrive? Thanks!
is network drive another computer..?
Avatar of ltyao

ASKER

Yes, the drives will be mapped in another computer. Before I use vb script to map networkdrive, no any problem. I thought that ASP also can be implemented by vb script, should work in same way. But I can't figure out why it didn't work.

Thanks!
https://www.experts-exchange.com/questions/21392716/I-am-Getting-a-'Permission-Denied'-error-when-trying-to-connect-to-an-Access-Database-residing-on-a-different-computer.html

ltyao, I encourage you to read this one thoroughly not just accepted answer, same issue was solved and bunch of other good info has been shared
Avatar of ltyao

ASKER

Hi, davidlars99 :
       Thanks for your information, I do learn a lot. Unfortunately, this still didn't solve my problem.
       I use "objNetWork.MapNetworkDrive "H:", "\\genabc\DATA" , strProfile, strUser, strPassword" in my ASP page. at beginning it does map to networkdrive, then I thought that it was not a permission issue, (because I use VB script to map networkdrive, it works fine, never complain permission problem, I use the same code in ASP). Unfortunately, after I run this page a few times, it only display "Network Drive (H)", when you try to disconnect this drive, it tells you "Network drive couldn't be found".
       Now I'm confusing very much, don't know what I was doing wrong. If you have any suggestion or solution, please let me know, thanks!

after all it may have to do with the security settings on the website. If you have the default user as the anonymous user (usualy IUSR_<machinename>) this user does not have permission to create a map drive on the sytem or at least is limited, change the setting in IIS for the website to be run as a local box user that has permissions to perform this action and it should work for you.
change security options only on that particular asp page and nothing else, use appropriate user and require login to access that page.
Avatar of ltyao

ASKER

I just check my account IUSER_ComputerName, how to I change this account permission? Thanks!
Avatar of ltyao

ASKER

Afte run this asp page, it can display "H:", "\\genabc\DATA" on webpage. but if expand all of drives, you only still can see "Network Drive (H)". I think that this program already connect to network to get  Drive Letter and Shareserver name, but why it doesn't display on computer. THanks!
ASKER CERTIFIED SOLUTION
Avatar of davidlars99
davidlars99
Flag of United States of America image

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
Avatar of ltyao

ASKER

Hi, davidlars99

         You are geniuses!
          I just do the change followed the first method, it works fine now. Thank you very much! I really appreciate!
as I said earlier, do not give direct access to untrusted users to that page instead you should require them to login!