Re: MoveFile problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Curt_C [MVP] (software_AT_darkfalz.com)
Date: 01/31/05


Date: Mon, 31 Jan 2005 08:54:22 -0600

verify all your values first. Make sure that they are all what you expect.
Write em out to the screen.
If that works try hardcoding a simple file with the objects you indicated,
see what happens.

Then combine the two....
Basic troubleshooting methodology.

-- 
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Patrice" <manitoo@videotron.ca> wrote in message 
news:lMqLd.41023$Rw4.662668@weber.videotron.net...
> Hi,
> I want to move images from a folder to specific subfolders.
> The script below generates the following error:
> a.. Error Type:
> Microsoft VBScript runtime (0x800A01A8)
> Object required:'[undefined]'
>
> <%
> sub moveImagesToFolder(Folder)
> dim fs,fo,x,text,Foldername,fm,f1
> set fs=Server.CreateObject("Scripting.FileSystemObject")
> set fo=fs.GetFolder(Server.MapPath(Folder))
>     for each x in fo.files
>         text=Len(x.Name)-4
>         Foldername=Left(x.Name,text)
>          set f1 = fs.GetFile(x)
>
> '/////here is where the error is targeted: don't know why!////
>          set 
> fm=fs.MoveFile(f1,"C:\Inetpub\wwwroot\"&Folder&"\"&Foldername&"\")
>
>          set fm=nothing
>          set f1=nothing
>     next
>  set fs=nothing
> set fo=nothing
> end sub
>
> %>
>
> Can someone help?
> Thx
>
> 


Relevant Pages

  • Re: WScript Application Error
    ... Option Explicit ... Sub RemovePrinter ... Active Directory domain and have logon scripts launched via GP. ... Set WshNetwork = WScript.CreateObject ...
    (microsoft.public.scripting.vbscript)
  • clueless newbie to web programming
    ... database retrievals and page layout done. ... data between the scripts. ... displaying of data and go directly to the data entry script. ... sub enter_date ...
    (comp.lang.perl.modules)
  • CDO, MAPI VBScript just stops
    ... I have a VBSCRIPT which scans through a Public folder called ... Under AUTO-RESPONSE, there are 20 or so Sub folders ... I have three scripts. ...
    (microsoft.public.scripting.vbscript)
  • Re: How can I display the calendar - limited user?
    ... attached a screenshot of it showing my current disk usage. ... more desirable to have the scripts run locally instead of on the server, ... If you can't figure out how to launch an EXE through scripting, ... Sub LaunchEXE(strApp) ...
    (microsoft.public.windowsxp.customize)
  • Re: Dynamic directory handles?
    ... >> These are values that should be returned by your sub. ... I don't quite get the reasoning behind using poor programming practices ... Programming definately involves developing habbits. ... > Must admit I get a bit lazy in CGI scripts with that, ...
    (comp.lang.perl.misc)