Create Map Drive Using Asp Code

Create Map drive within VPN using ASP

Page 1 of 1

3 Replies - 22141 Views - Last Post: 01 February 2005 - 04:06 PM Rate Topic: -----

#1 htaquee   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-December 04

Create Map Drive Using Asp Code

Post icon  Posted 21 December 2004 - 01:23 PM

<%@ language="vbscript" %>
<%

Dim aga
Set aga = CreateObject("Wscript.Network")
aga.MapNetworkDrive "X:","\\192.168.1.10\c\",,"admin","mypass"

%>

Can anyone tell me where am i going wrong? I am trying to create drive X from my network computer hooked up by using VPN.

It work fine if i run vbs using similar code. but when i try to run from IIS5 ...it gives error
(
Error Type:
WSHNetwork.MapNetworkDrive (0x80070520)
A specified logon session does not exist. It may already have been terminated.
)
you can email me at [email protected]

All the help is highly appreciated.

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Create Map Drive Using Asp Code

#2 Amadeus   User is offline

  • g+ + -o drink whiskey.cpp
  • member icon

Reputation: 250
  • View blog
  • Posts: 13,507
  • Joined: 12-July 02

Re: Create Map Drive Using Asp Code

Posted 22 December 2004 - 07:05 AM

Hmm...that's an odd one. I'm not sure whhat the trouble might be, but some suggestions might be that the verification may be looking for your VPN security information as opposed to the network security information. to be honest, the code looks fine, I've used similar myself to map to drives, that's what makes me think the problem may be in the connection. the error message itself is one that's often generated when a drive needs at least one actual user to be logged on before making a mapping through ASP.

Although I am not specifically advocating the use of .NET (I have as many problems with it as praise), have you installed the framework? The .NET components do have some more advanced objects, perhaps you could code the connection page as a .NET app, then transfer back to a regular asp page.
Was This Post Helpful? 0
  • +
  • -

#3 Maxtor   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 01-February 05

Re: Create Map Drive Using Asp Code

Posted 01 February 2005 - 02:56 PM

It may have to do with the security settings on the website. If you have the default user as the anonymous user this user does not have permission to create a map drive on the sytem. 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.
Was This Post Helpful? 0
  • +
  • -

#4 htaquee   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-December 04

Re: Create Map Drive Using Asp Code

Posted 01 February 2005 - 04:06 PM

Dear Friends,

Thanks but I am now using vbs for doing the same task and this script run on a server every 10 minutes. and later on my application carry on from that point.

there are always a way around....:) so i used it and my application is working just fine.

Thank you for all your kind help.

regards

Husain Taquee
Sr.Programmer
[email protected]
www.imageoptometry.com

This post has been edited by htaquee: 27 April 2006 - 10:33 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1