Problems Deleting a File

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mike

    #1

    Problems Deleting a File

    I am trying to delete a excel file after it has been validated for
    errors and then put into another folder for processing. My problem is,
    when I click on the submit button, the excel file is being put into
    the correct folder, but I am getting a permission denied error on my
    file2 delete statement below. But if I hit the refresh button, the
    file gets deleted the way I want it to. What do I need to do to stop
    the permission denied error? Following is the code I am using to
    delete the files:

    function deleteStoreTemp Files()
    {

    var file2;
    var file3;

    file2 = fso.GetFile(sto refolder + filename1);
    file3 = fso.GetFile(tem pfolder + "tmp_" + filename1);
    file2.Delete();
    file3.Delete();

    }

    TIA for any help anyone can give me!

    Mike
  • Andy Fish

    #2
    Re: Problems Deleting a File

    it looks like your problem has more to do with jscript or the
    FileSystemObjec t than javascript. probably better to ask in
    microsoft.publi c.activex.progr amming.scriptin g.jscript


    "Mike" <wolverine1654@ yahoo.com> wrote in message
    news:2ec1fa48.0 308181107.1c4b5 b75@posting.goo gle.com...[color=blue]
    > I am trying to delete a excel file after it has been validated for
    > errors and then put into another folder for processing. My problem is,
    > when I click on the submit button, the excel file is being put into
    > the correct folder, but I am getting a permission denied error on my
    > file2 delete statement below. But if I hit the refresh button, the
    > file gets deleted the way I want it to. What do I need to do to stop
    > the permission denied error? Following is the code I am using to
    > delete the files:
    >
    > function deleteStoreTemp Files()
    > {
    >
    > var file2;
    > var file3;
    >
    > file2 = fso.GetFile(sto refolder + filename1);
    > file3 = fso.GetFile(tem pfolder + "tmp_" + filename1);
    > file2.Delete();
    > file3.Delete();
    >
    > }
    >
    > TIA for any help anyone can give me!
    >
    > Mike[/color]


    Comment

    Working...