Solved

Using ASPExec to transfer to a mapped drive

Posted on 2003-11-20
13
366 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
0
 
LVL 21

Expert Comment

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

Cheers!!
0
 
LVL 1

Author Comment

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

Yes, same user and pass.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Author Comment

by:gormly
Comment Utility
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
Comment Utility
I'll try and post some code tomo... dont have time now..

Cheers!!
0
 
LVL 1

Author Comment

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

Expert Comment

by:ap_sajith
Comment Utility
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
Comment Utility
I will try and post results.
0
 
LVL 1

Author Comment

by:gormly
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
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/…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

743 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

16 Experts available now in Live!

Get 1:1 Help Now