Solved

Using ASPExec to transfer to a mapped drive

Posted on 2003-11-20
13
367 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
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…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

862 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now