TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: wjbzone on November 21, 2006, 08:18:01 PM

Title: Run a .exe program from autolisp?
Post by: wjbzone on November 21, 2006, 08:18:01 PM
I have several programs I wrote 20+ years ago (compiled fortran) that I would like to run from a autolisp command. I tried startapp but does not work.

(startapp "E:\0\REAME.EXE")           ; returns nil
(startapp "cmd" "E:\0\REAME.EXE") ;returns 33, launches cmd window,but does not run the pgm.

These programs (*.exe) run fine in DOS (or the cmd window).

Is there any way I can use these from a lisp or autocad command?

Thanks,
Bill

(I was shocked when I was able to retrieve these *. for files from my old stash of 5.25" floppies and re-compile)

Title: Re: Run a .exe program from autolisp?
Post by: GDF on November 21, 2006, 08:33:13 PM
Here is what I do...

Code: [Select]
(defun C:RESHACKR  (/ rh) 
  (setq rh (findfile (strcat ARCH#DIRL "Arch_Tools/Exe_ResHacker/RESHACKER.exe")))
  (if (= rh nil)
    (setq rh (findfile (strcat "P:/" "Arch_Tools/Exe_ResHacker/RESHACKER.exe")))
  )     
  (cond
    ((= rh nil)
     (ARCH:ALERT-E
       "MsgBox \"
     Program Error
--------------------------------------------------------------------------------------------
     Program not Installed !!!\""))
    ((/= rh nil)
     (command "start" rh)))
  (princ))
;;;
(defun C:SLIDEMAN  (/ sm)
  (setq sm (findfile (strcat ARCH#DIRL "Arch_Tools/Exe_SlideMan/SLIDEMAN.exe")))
  (if (= sm nil)
    (setq sm (findfile (strcat "P:/" "Arch_Tools/Exe_SlideMan/SLIDEMAN.exe")))
  )
  (cond
    ((= sm nil)
     (ARCH:ALERT-E
       "MsgBox \"
     Program Error
--------------------------------------------------------------------------------------------
     Program not Installed !!!\""))
    ((/= sm nil)
     (command "start" sm)))
  (princ))

Gary
Title: Re: Run a .exe program from autolisp?
Post by: Andrea on November 21, 2006, 10:35:13 PM
Code: [Select]
(startapp "E:\\0\\REAME.EXE")
or

Code: [Select]
(startapp "E:/0/REAME.EXE")