- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Ok, so what I am trying to do is very simple, however, which ever way I approach it I am having issues...
I want to delete the file called acad.lsp located in C:\Program Files\Autodesk\AutoCAD 2023\Support\
I tried (vl-file-delete) but that fails. I assume AutoCAD wont let you do that...
(vl-file-delete "C:\\Program Files\\Autodesk\\AutoCAD 2023\\Support\\acad.lsp")
So then I decided to try workarounds... I can make a .BAT file to delete acad.lsp and then launch it with AutoLisp
Delete_acad_lsp.bat file looks like this
del "C:\Program Files\Autodesk\AutoCAD 2023\Support\acad.lsp"
And in AutoLisp I can launch it like this, however, I get access denied because it needs to be run with admin privileges
(startapp "C:\\Program Files\\Autodesk\\AutoCAD 2023\\Support\\Delete_acad_lsp.bat")
So then I decided to make a shortcut pointing to Delete_acad_lsp.bat with administrative privileges. However (startapp) doesn't work on shortcut files...
(startapp "C:\\Users\\Public\\Desktop\\Delete_acad_lsp.lnk")
Any ideas on how I can do this?: I don't care how, I just want to delete acad.lsp from an autolisp routine launched from AutoCAD
Solved! Go to Solution.