Solved

Using ASPExec to transfer to a mapped drive

Posted on 2003-11-20
13
371 Views
Last Modified: 2008-02-26
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?
0
Comment
Question by:gormly
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 6
13 Comments
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9788703
You need to assign proper permissions for the IUSR account...

Silvers5 has explained thie in detail at http://oldlook.experts-exchange.com/Web/Web_Languages/ASP/Q_20109505.html

Cheers!!
0
 
LVL 1

Author Comment

by:gormly
ID: 9810366
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?
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9810499
Did you go through this link?. try using FSO as described in the article..

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q197/9/64.ASP&NoWebContent=1

Cheers!!
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 21

Expert Comment

by:ap_sajith
ID: 9810552
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9810562
have you given write permissions for the IUSR account on the second server?

Cheers!!
0
 
LVL 1

Author Comment

by:gormly
ID: 9811098
>> have you given write permissions for the IUSR account on the second server?

Yes, same user and pass.
0
 
LVL 1

Author Comment

by:gormly
ID: 9851149
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.

0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9851248
I'll try and post some code tomo... dont have time now..

Cheers!!
0
 
LVL 1

Author Comment

by:gormly
ID: 9851341
thanks for the help.
man this is killing me.
0
 
LVL 21

Expert Comment

by:ap_sajith
ID: 9904432
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")
demofile.Copy("M:\someotherfile.txt")
' OR
'demofile.Copy("\\servername\share\someotherfile.txt")

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

http://support.microsoft.com/support/kb/articles/Q197/9/64.ASP 

Cheers!!
0
 
LVL 1

Author Comment

by:gormly
ID: 9905413
I will try and post results.
0
 
LVL 1

Author Comment

by:gormly
ID: 9906274
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?
0
 
LVL 21

Accepted Solution

by:
ap_sajith earned 125 total points
ID: 9909550
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. http://support.microsoft.com/support/kb/articles/Q197/9/64.ASP 

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.

Cheers!!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

732 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