|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problem with MoveFile command in ASP pageThe 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 youdon't need to double them in file paths. Mattias -- Mattias Sjögren [C# MVP] mattias @ mvps.org http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com Please reply only to the newsgroup. 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 Show quoteHide quote "RSH" <way_beyond_o***@yahoo.com> schreef in bericht news:eCecNbSdGHA.4108@TK2MSFTNGP03.phx.gbl... >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 > >
strange behavior , has someone an explanation for this ??
how to not use VB.net Format Strings in DataGrid Column Style Windows Forms and Console Application [VB2005EE] accessing control-specific functions via form's ActiveControl Data type conversion question Developing ASP.NET 2.0 Applications Visual C to Visual Basic Converstion Help... textbox numeric with 2 decimals .Net Mail only goes to one |
|||||||||||||||||||||||