Using ASPExec to transfer to a mapped drive

Hey all

I am using ASPExec to copy files amoung my web servers drives.

However, I have a need to copy the files to a mapped drive location, but nothing seems to work.

H:\ in this example is a mapped drive.

  Set Executor = Server.CreateObject("ASPExec.Execute")
  Executor.Application = "cmd /c copy E:\temp\*.* H:\"
  Executor.Parameters = ""
  strResult = Executor.ExecuteDosApp
  Response.Write "<pre>" & strResult & "</pre>"

It works great with the local drives.. just doesn't work with any mapped drive.
How can I make it work with a mapped drive?
Who is Participating?
Yeah.. Permissions with mapped drive is always an issue.. and as i know.. the link from MS is the best source yet on how to go about giving permissions. 

You could execute the bat file from the asp page usig the shell object or asp exec....but then again.. the IUSR and maybe IWAM accounts needs to have sufficient permissions.

You need to assign proper permissions for the IUSR account...

Silvers5 has explained thie in detail at

gormlyAuthor Commented:
This isn't working for me..
I have no idea whats going on.

I created the users to match, I extracted the password from the local server, assigned the same thing to the new user on the other server and still nothing.

Doesn't work for me.

anything else I could try?
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Did you go through this link?. try using FSO as described in the article..

have you given write permissions for the IUSR account on the second server?

gormlyAuthor Commented:
>> have you given write permissions for the IUSR account on the second server?

Yes, same user and pass.
gormlyAuthor Commented:
Nothing is working correctly.
I have triple checked, triple read...  nothing.

This stinks!!!

Is there any other method besides FTP that I can use to fire a copy files event from one server to move files to another via an asp page?

I need to have users click a button to update the new website data from our "old" site (where the fresh data goes each morning.

I'll try and post some code tomo... dont have time now..

gormlyAuthor Commented:
thanks for the help.
man this is killing me.
Sorry.. Forgot about this one...

Map to say, "M:\"

dim filesys, demofile
set filesys = CreateObject ("Scripting.FileSystemObject")
set demofile = filesys.CreateTextFile ("c:\somefile.txt", true)
set demofile = filesys.GetFile("c:\somefile.txt")
' OR

The above example uses FSO to do the copy the file to the shared drive. Again, you should give write permissions for the IUSR account as explained above.

You could try using the shell object as well...
Set oShell = Server.CreateObject("Wscript.Shell")
CMD = "%Comspec% /c c:\File1.txt m:\File2.txt"
oShell.Run CMD, 0, True 

gormlyAuthor Commented:
I will try and post results.
gormlyAuthor Commented:
doesn't work for me...

Let me ask this.
I have a command line tool that works in a bat file (it calls another program to do the file compare/sync).
It works great.. problem is I need it done via a webpage, so executing that bat file would work perfectly.
But since nothing I do works correctly.....

Is there a way to give the webuser the credentials needed to run the bat file?

I currently login accross the network as Admin and I can run bat files with sucess.
If I try to run the bat file via web page.. it doesn't work.

(I know.. I know.. permisions)

Is there away to assign permissions to allow this?
How about a seperate website that gives access as the admin?
possible?  If so.. how?

Maybe this is an alternative?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.