deletefile problem

Results 1 to 2 of 2

Thread: deletefile problem

  1. #1
    Join Date
    Dec 1969

    Default deletefile problem

    hi, i&#039;m trying to delete a file using the filesystemobject. the error i receive is:<BR><BR>Object required: &#039;DeleteFile(...)&#039;<BR><BR><BR>and yet, it still deletes the file because when i refresh the page the error read: file not found.<BR><BR>for the record, i&#039;m actaully trying to delete a file and then, immediately after, recreate the file again. if someone can suggest a more efficient way of "clearing the text file", i&#039;d love to hear it.<BR><BR>my code:<BR><BR>&#060;%option explicit%&#062;<BR>&#060;%<BR>Dim thisfile, fs, navfile<BR>thisfile=server.mappath("text_file/afile.txt")<BR>Set fs = CreateObject("Scripting.FileSystemObject")<BR>Set navfile = fs.DeleteFile(thisfile,False)<BR>%&#062;<BR><BR>&# 060;%<BR>Dim newfile, rs, file<BR>newfile=server.mappath("text_file/afile.txt")<BR>Set rs = CreateObject("Scripting.FileSystemObject")<BR>Set file = fs.CreatTextFile(whichfile, True)<BR>set navfile=nothing<BR>navfile.close<BR>set whichfile=nothing<BR>whichfile.close<BR>set fs=nothing<BR>fs.close<BR>set file=nothing<BR>file.close<BR>set newfile=nothing<BR>newfile.close<BR>set rs=nothing<BR>rs.close<BR><BR><BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default Check this out

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts