Link to home
Start Free TrialLog in
Avatar of gormly
gormly

asked on

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?
Avatar of ap_sajith
ap_sajith

You need to assign proper permissions for the IUSR account...

Silvers5 has explained thie in detail at http://oldlook.experts-exchange.com/questions/20109505/Copy-file-to-different-server.html

Cheers!!
Avatar of gormly

ASKER

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?
have you given write permissions for the IUSR account on the second server?

Cheers!!
Avatar of gormly

ASKER

>> have you given write permissions for the IUSR account on the second server?

Yes, same user and pass.
Avatar of gormly

ASKER

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

Cheers!!
Avatar of gormly

ASKER

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")
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!!
Avatar of gormly

ASKER

I will try and post results.
Avatar of gormly

ASKER

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?
ASKER CERTIFIED SOLUTION
Avatar of ap_sajith
ap_sajith

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial