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("ASPEx ec.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?
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("ASPEx
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?
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?
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?
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!!
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q197/9/64.ASP&NoWebContent=1
Cheers!!
have you given write permissions for the IUSR account on the second server?
Cheers!!
Cheers!!
ASKER
>> have you given write permissions for the IUSR account on the second server?
Yes, same user and pass.
Yes, same user and pass.
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 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!!
Cheers!!
ASKER
thanks for the help.
man this is killing me.
man this is killing me.
Sorry.. Forgot about this one...
Map to say, "M:\"
dim filesys, demofile
set filesys = CreateObject ("Scripting.FileSystemObje ct")
set demofile = filesys.CreateTextFile ("c:\somefile.txt", true)
set demofile = filesys.GetFile("c:\somefi le.txt")
demofile.Copy("M:\someothe rfile.txt" )
' OR
'demofile.Copy("\\serverna me\share\s omeotherfi le.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("Wscri pt.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!!
Map to say, "M:\"
dim filesys, demofile
set filesys = CreateObject ("Scripting.FileSystemObje
set demofile = filesys.CreateTextFile ("c:\somefile.txt", true)
set demofile = filesys.GetFile("c:\somefi
demofile.Copy("M:\someothe
' OR
'demofile.Copy("\\serverna
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("Wscri
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!!
ASKER
I will try and post results.
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Silvers5 has explained thie in detail at http://oldlook.experts-exchange.com/questions/20109505/Copy-file-to-different-server.html
Cheers!!