473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Problem with MoveFile command in ASP page

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
May 11 '06 #1
2 1286
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

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
May 11 '06 #2
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

"RSH" <wa*************@yahoo.com> schreef in bericht
news:eC**************@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

May 11 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Shelley | last post by:
Hi Everyone, Does anyone know what object it is in the MoveFile Method object.MoveFile source, destination in access? Any help will be highly appreciated!
0
by: RSH | last post by:
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...
3
by: aldonnelley | last post by:
Hi all. Just having a weird problem with tkinter. I'm trying to make a gui that shows results from an image search, with a "forward" and "back" button so the user can compare results from...
1
by: PhilD | last post by:
My C#.NET console app checks a public folder every 24 hours for incoming emails. For each unread email in the folder, it copies any attachments to the network, then loads the contents of these files...
2
by: DC | last post by:
The Code <%@ import namespace="System" %> <%@ import namespace="System.Web" %> <%@ import namespace="System.Web.UI" %> <%@ import namespace="System.Web.UI.HtmlControls" %> <%@ import...
6
by: Mat N | last post by:
Hello access friends, (Originally posted on access.formsprogramming which I think was the wrong place) I'm precalculating a bunch of data for my clients as per a profile I have for each of...
1
by: gzannd | last post by:
I have a problem with submitting a form to a PHP page through a dynamically created IFRAME in IE7. This code works fine in Firefox. However, IE7 submits an empty form--the correct PHP page is...
12
by: Tim Wallace | last post by:
I have a windows 2000 server on which I have installed the .NET 2.0 Framework runtime. I have an application I've written using VS 2005. In it, I use master pages. When I debug this app on my...
4
by: b00gieman | last post by:
Hello! I'm using the MoveFile method for moving files between 2 servers , one running my asp script and the other running my database.My problem is that I'm getting the error: Microsoft VBScript...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.