Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using ASPExec to transfer to a mapped drive

Posted on 2003-11-20
13
Medium Priority
?
378 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 500 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

610 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