Skip to main content
Inspiring
July 16, 2008
Question

Use Scripting.FileSystemObject instead of CFFILE

  • July 16, 2008
  • 1 reply
  • 494 views
Ok. I'm having some issues with CFFILE where it cant delete a file that was either just read or "touched" and CFFILE throws an error. It is due to the file being locked. I have almost giving up trying to use CFFILE and i am resorting to using FSO Scripting.FileSystemObject instead, which has bailed me out on issues in the past.

What I am trying to do is basically just delete a file. My code is as such: ( this is just to test )

<CFOBJECT TYPE="COM" CLASS="Scripting.FileSystemObject" NAME="FSO" ACTION="CREATE">
<cfscript>
FSO.DeleteFile("d:\directory\somefile.psp");
</cfscript>

Im getting an exception error when trying to do so:
The cause of this exception was that: AutomationException: 0x800a0046 - .

BTW I got the reference on the DELETEFILE() from ASP based code references.

Has anyone ever done this before? and if so, what Am I doing wrong? any one want to try to come up with a solution? I could use a bit of help on this one 😐
    This topic has been closed for replies.

    1 reply

    Inspiring
    July 17, 2008
    wasn't there a hotfix that addresses this cffile issue?

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/