?
Solved

How to mapnetworkdrive in ASP?

Posted on 2005-04-27
13
Medium Priority
?
1,109 Views
Last Modified: 2011-10-03
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!
0
Comment
Question by:ltyao
  • 6
  • 6
13 Comments
 
LVL 20

Expert Comment

by:jitganguly
ID: 13879887
Most probably permission issue. Does IUSR_{yourservername} user has permission to remove network drive ?
0
 

Author Comment

by:ltyao
ID: 13880827
I run the page on localhost, how to know if I have permission to remove networkdrive? Thanks!
0
 
LVL 13

Expert Comment

by:davidlars99
ID: 13882137
is network drive another computer..?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:ltyao
ID: 13885451
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!
0
 
LVL 13

Expert Comment

by:davidlars99
ID: 13885507
http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_21392716.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
0
 

Author Comment

by:ltyao
ID: 13895128
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!

0
 
LVL 13

Expert Comment

by:davidlars99
ID: 13895243
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.
0
 
LVL 13

Expert Comment

by:davidlars99
ID: 13895310
change security options only on that particular asp page and nothing else, use appropriate user and require login to access that page.
0
 

Author Comment

by:ltyao
ID: 13895737
I just check my account IUSER_ComputerName, how to I change this account permission? Thanks!
0
 

Author Comment

by:ltyao
ID: 13896361
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!
0
 
LVL 13

Accepted Solution

by:
davidlars99 earned 200 total points
ID: 13897354
>  I just check my account IUSER_ComputerName, how to I change this account permission? Thanks!....

don't always do it, in this case you'd better change accessing user from UISR_<machinename> to some power user which has more administrative right and require login to access this page, I will show you both.


[changing default user]

1. right click on "My Computer" and select "Manage"
2. in the next window expand "Services and Application"
3. then expand "Internet Information Services" and find directory where you ASP file is located
4. right click on that ASP file and select "Properties", you're gonna see dialog window with few tabs
5. in the first tab window check "Read", "Write" properties
6. now navigate to "File Security" tab and click on "Edit", when dialog window opens there's gonna be another "Edit" (first one) button click on that too
7. in the next window you'll see IUSR_<machinename> followed by "Browse" button, click on that and choose the user which you think has rights for your needs, enter password and check off "Allow IIS to control Password"


[adding rights to <IUSR_<machinename> (not recommended)]

1. right click on "My Computer" and select "Manage"
2. expand "Local Users and Groups"
3. click on "Users" and look into right window pane
4. right click on "IUSR_<machinename>" and select "Member Of" tab
5. click on "Add" button and add any user that you think has anough right to do what you gotta do...
0
 

Author Comment

by:ltyao
ID: 13898441
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!
0
 
LVL 13

Expert Comment

by:davidlars99
ID: 13899185
as I said earlier, do not give direct access to untrusted users to that page instead you should require them to login!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

864 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