Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. Not able to delete a file using FileSystemObject using ASP

Not able to delete a file using FileSystemObject using ASP

Scheduled Pinned Locked Moved Web Development
helpsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Ankur Bakliwal
    wrote on last edited by
    #1

    Hi All, I need to delete a file using ASP. So i m using FSO (FileSystemObject). i used -

    FileNameStr = "D:\abc\xyz.txt"
    set fso=Server.CreateObject("Scripting.FileSystemObject")
    if fso.FileExists(FileNameStr) = true Then
    fso.DeleteFile FileNameStr,true
    End IF

    using above code the file is not getting deleted. Please help me on this problem & let me know what to do. Thanks, Ankur Bakliwal

    S 1 Reply Last reply
    0
    • A Ankur Bakliwal

      Hi All, I need to delete a file using ASP. So i m using FSO (FileSystemObject). i used -

      FileNameStr = "D:\abc\xyz.txt"
      set fso=Server.CreateObject("Scripting.FileSystemObject")
      if fso.FileExists(FileNameStr) = true Then
      fso.DeleteFile FileNameStr,true
      End IF

      using above code the file is not getting deleted. Please help me on this problem & let me know what to do. Thanks, Ankur Bakliwal

      S Offline
      S Offline
      Shog9 0
      wrote on last edited by
      #2

      You (the credentials you're running under) don't have permission to delete the file. Or something (possibly you) has the file open. Or the path is bogus. Can't really tell from this end. Try FileMon or ProcMon[^] to identify the actual error (if there is one). Also, try logging errors.

      Citizen 20.1.01

      'The question is,' said Humpty Dumpty, 'which is to be master - that's all.'

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups