+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Super Member
    Using
    not specified
    Join Date
    Feb 2006
    Posts
    527

    Default Lisp routine to delete a file form "C" drive

    Registered forum members do not see this ad.

    AutoCAD 2000 or above.

    Is there a lisp command/routine to delete a file from my "C" drive
    Say I would like to delete "test.txt" from the root directory
    of my "C" drive.
    Thank you,

  2. #2
    Senior Member Norts's Avatar
    Using
    Map 3D 2008
    Join Date
    Nov 2006
    Location
    Manchester, UK
    Posts
    448

    Default

    it would be quicker to do this from windows explorer, rather than a version of autocad
    Posting no more
    ...................................................


  3. #3
    Senior Member
    Computer Details
    VVA's Computer Details
    Operating System:
    Windows 7
    CPU:
    Intel Core i5-2400
    RAM:
    8 Gb
    Graphics:
    Nvidia Quadro 600
    Primary Storage:
    Seagate 500 GB + WD 750 GB
    Monitor:
    Philips 27"
    Using
    AutoCAD 2013
    Join Date
    Dec 2006
    Location
    Minsk, Belarus
    Posts
    401

    Default

    Code:
    (defun delfile (file)
      (vl-load-com)
      (if (vl-file-systime file)
        (vl-file-delete file)
        (alert (strcat "Can'nt delete " file
                       "\nMaybe deleted or open"))
        )
      )
    (defun C:DELFILE ()(delfile "C:\\test.txt"))

  4. #4
    Luminous Being dbroada's Avatar
    Computer Details
    dbroada's Computer Details
    Operating System:
    XP Pro
    Computer:
    Dell
    CPU:
    Intel Xeon 2.13GHz
    RAM:
    2GB
    Graphics:
    NVIDA Quadro FX 580
    Monitor:
    DELL 23" & SAMSUNG 21"
    Discipline
    Electro/Mech
    dbroada's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Electro/Mech
    Using
    Electrical 2013
    Join Date
    Nov 2005
    Location
    Sussex, UK
    Posts
    5,024

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Norts View Post
    it would be quicker to do this from windows explorer, rather than a version of autocad
    not always true. I quite often use files as temporary storage and need to delete them within the routine. Having said that I can't remember how to do it.
    "That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson

    Dave

Similar Threads

  1. "File open default locatio"
    By Redman68 in forum AutoCAD Drawing Management & Output
    Replies: 4
    Last Post: 29th Oct 2007, 07:00 pm
  2. "LINK template" icons "greyed out" -why?
    By Chrisjpritchard in forum AutoCAD Drawing Management & Output
    Replies: 0
    Last Post: 2nd Mar 2007, 10:25 pm
  3. Acad 2004, Can you use a raster file in "Hide"
    By f700es in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 7th Aug 2006, 02:25 pm
  4. "open file" setting changed somehow...
    By MostlyLqd in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 19th May 2006, 10:46 pm
  5. "Union" Meshes or "Slice" 3D Mesh
    By Peter31712 in forum AutoCAD 3D Modelling & Rendering
    Replies: 1
    Last Post: 29th Apr 2004, 11:11 pm

Bookmarks

Posting Permissions

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