For Programmers: Free Programming Magazines  


Home > Archive > ASP > March 2004 > FileSystemObject my movefile does not work









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author FileSystemObject my movefile does not work
Daniel

2004-03-28, 9:55 pm

Hi everybody

I am trying to move around some files via fso. My asp code is like the
following:

.. . . . . snip . . . .
<%
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Test = objFSO.MoveFile ( "c:\test\document.txt",
"c:\test2\document.txt")
%>
.. . . . . snip . . . .

In the IE windows I always get
Errortype:
Runtime error in Microsoft VBScript (0x800A01A8)
Objekt required: '[undefined]'
and the script name and error line (which is the Set Test... line)

I dont understand what object is missing.

If using my XPPro machine as webserver the page stands still and the
scipt is not processed.
On my test environment with win2003 IIS its the same message but the
required files are moved and the script continues running
btw - same problem seems to be with the .DeleteFile fso

What ist the problem?

Daniel


-----= Posted via webservertalk.com, Uncensored Usenet News =-----
http://www.webservertalk.com - The #1 Newsgroup Service in the World!
-----== Over 100,000 Newsgroups - 19 Different Servers! =-----
McKirahan

2004-03-28, 9:55 pm

"Daniel" <lapin_no_spam_please@datacomm.ch> wrote in message
news:77d530drte4vg7e9vgj2rspcjscdmm95qh@
4ax.com...
> Hi everybody
>
> I am trying to move around some files via fso. My asp code is like the
> following:
>
> . . . . . snip . . . .
> <%
> Set objFSO = CreateObject("Scripting.FileSystemObject")
> Set Test = objFSO.MoveFile ( "c:\test\document.txt",
> "c:\test2\document.txt")
> %>
> . . . . . snip . . . .
>
> In the IE windows I always get
> Errortype:
> Runtime error in Microsoft VBScript (0x800A01A8)
> Objekt required: '[undefined]'
> and the script name and error line (which is the Set Test... line)
>
> I dont understand what object is missing.
>
> If using my XPPro machine as webserver the page stands still and the
> scipt is not processed.
> On my test environment with win2003 IIS its the same message but the
> required files are moved and the script continues running
> btw - same problem seems to be with the .DeleteFile fso
>
> What ist the problem?
>
> Daniel


Three things:

1) Server.CreateObject
2) Remove "Set Test = "
3) Optionally (I think), just specify the destination folder

<%
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
objFSO.MoveFile ( "c:\test\document.txt","c:\test2\")
%>


Daniel

2004-03-28, 9:55 pm

Thanks - that worked!

On Wed, 18 Feb 2004 14:44:03 GMT, "McKirahan" <News@McKirahan.com>
wrote:

>"Daniel" <lapin_no_spam_please@datacomm.ch> wrote in message
> news:77d530drte4vg7e9vgj2rspcjscdmm95qh@
4ax.com...
>
>Three things:
>
>1) Server.CreateObject
>2) Remove "Set Test = "
>3) Optionally (I think), just specify the destination folder
>
><%
>Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
> objFSO.MoveFile ( "c:\test\document.txt","c:\test2\")
>%>
>


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com