Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Running a batch file on CAD Startup

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
Nathan_Tigner
289 Views, 4 Replies

Running a batch file on CAD Startup

Hi everyone!
 
I need a batch file to run one time when AutoCAD is first opened. 
 
I assumed I could just use startup in acad.lsp and that would do the trick.
 

 

(startapp "W://_RESOURCE//_CAD//PROGRAMS//CESO_STDS_DL_ARCH.bat")

 

 
But it does nothing.
 
I then tried to put the startapp command inside a lisp then call the lisp in acad.lsp.
 

 

(defun c:ceso_stds_dl()
(startapp "W://_RESOURCE//_CAD//PROGRAMS//CESO_STDS_DL.bat")
(princ)
)

 

 
Still no luck. Any ideas for a way to run the batch file only on CAD startup? 
 
I could put it in acaddoc.lsp and it works, but I don't want the batch file to run everytime a drawing is opened. Just once. 
Tags (3)
Labels (3)
4 REPLIES 4
Message 2 of 5
Kent1Cooper
in reply to: Nathan_Tigner

Your double forward slashes may be the problem.  Try using either double backslashes or single forward slashes as filepath separators.

Kent Cooper, AIA
Message 3 of 5

I hate to admit this ...

But I was editing the wrong acad.lsp file.

I manage a few hundred CAD users across multiple disciplines and each discipline has their own acad and acaddoc.lsp.

I just opened the wrong one.

My original (startapp) worked perfectly in the correct lisp file.

About time to pack it up for the day I think.

Message 4 of 5
Sea-Haven
in reply to: Nathan_Tigner

"I manage a few hundred CAD users across multiple disciplines and each discipline has their own acad and acaddoc.lsp."

 

For us multi users we had Custom.lsp which you could have multiple versions each named to suit a group and just use Appload and put in the Startup suite. Much easier to manage when you do upgrades. 

 

I have an install lisp that does all the hard work setting support paths, menu's etc. Again could have different installs for each group.

Message 5 of 5
scot-65
in reply to: Nathan_Tigner

Let's minimize any errors that might occur:

(defun c:ceso_stds_dl( / a )
(setq a (findfile "W:\\_RESOURCE\\_CAD\\PROGRAMS\\CESO_STDS_DL.bat"))
(if a
(startapp a)
(alert (strcat "File \"" a "\" could not be located. "))
)
(princ)
)

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report