i can't delete file using this code

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pisey
    New Member
    • Nov 2009
    • 1

    i can't delete file using this code

    Code:
    function remove()
    {
    var myObject;
    myObject = new ActiveXObject("Scripting.FileSystemObject");
    var f = myObject.GetFile("c:\\test.txt");
    f.Delete();
    }
    Last edited by Dormilich; Nov 20 '09, 04:59 AM. Reason: Please use [code] tags when posting code
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    probably due to the security settings, I guess.

    anyway, this is a pure IE matter, since JavaScript has no access to the local file system.

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      Can you do anything with the FileSystemObjec t? E.g. can you add a file?

      What error do you see?

      Comment

      Working...