Author Topic: Run a .exe program from autolisp?  (Read 6369 times)

0 Members and 1 Guest are viewing this topic.

wjbzone

  • Guest
Run a .exe program from autolisp?
« 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)


GDF

  • Water Moccasin
  • Posts: 2081
Re: Run a .exe program from autolisp?
« Reply #1 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
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Run a .exe program from autolisp?
« Reply #2 on: November 21, 2006, 10:35:13 PM »
Code: [Select]
(startapp "E:\\0\\REAME.EXE")
or

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