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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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?
Did you go through this link?. try using FSO as described in the article..

Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.