Problem with MoveFile command in ASP page

  • Thread starter Thread starter RSH
  • Start date Start date
R

RSH

I have an ASP page that needs to move a file from one directory to another.
The code is quite simple but I can't seem to get it to work. I keep getting
a "Download Error: Procedure call or argument is not valid." error when it
hits the movefile part of the code.

What am I missing?


Dim fso = CreateObject("Scripting.FileSystemObject")

strFile1 = "C:\\Inetpub\\wwwroot\\20060118-QuarterlyReports-05112006.rpt"

strFile2 =
"C:\\Inetpub\\wwwroot\\Archive\\20060118-QuarterlyReports-05112006.rpt"

If fso.fileexists(strFile1) Then

fso.MoveFile(strFile1, strFile2)

End If



Thanks!

Ron
 
Ron,

This isn't an ASP newsgroup but ...

What am I missing?

Probably that backslash isn't an escape character in Basic so you
don't need to double them in file paths.


Mattias
 
RSH,

Probably has your ASPNET user (as it should be) no rights to do this in the
general Internet Folders and bellow.

I hope this helps,

Cor
 
Back
Top