Running a batch file on CAD Startup

Running a batch file on CAD Startup

Nathan_Tigner
Advocate Advocate
813 Views
4 Replies
Message 1 of 5

Running a batch file on CAD Startup

Nathan_Tigner
Advocate
Advocate
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. 
0 Likes
Accepted solutions (1)
814 Views
4 Replies
Replies (4)
Message 2 of 5

Kent1Cooper
Consultant
Consultant
Accepted solution

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

Kent Cooper, AIA
0 Likes
Message 3 of 5

Nathan_Tigner
Advocate
Advocate

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.

0 Likes
Message 4 of 5

Sea-Haven
Mentor
Mentor

"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.

0 Likes
Message 5 of 5

scot-65
Advisor
Advisor
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.

0 Likes