AutoLisp Shell command on Win 10 system

AutoLisp Shell command on Win 10 system

peter_thomson
Advocate Advocate
3,017 Views
5 Replies
Message 1 of 6

AutoLisp Shell command on Win 10 system

peter_thomson
Advocate
Advocate

Hi there,

 

Wrote a bit of code last night for plotting to a PDF but want to kill Adobe Reader programmatically if the file has already been plotted to a PDF AND is open in Adobe Reader. part of this code is to run a dos batch file from a shell command but it requires the use of the old 8.3 filepath/filename system for lisp to find and run the file. Like this....

 

(command "shell" "C:/Progra~1/MWHGlO~1/APCADT~1/Plotting/KILL_A~1.BAT")

 

Is there anything I should know about how things run in Win 10 that might affect how I write this code? It works beautifully in Win 7.

If not, there must be something i missed on that system..

 

Thanks in anticipation,

Peter T

Dunedin, New Zealand.

 

C3D 2015, Win 7 Enterprise

 

0 Likes
3,018 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
I just tried the following and it worked for me -
(if (setq FN (findfile "D:/C-Drive/Bat/Folder1234567890/SetNone.bat"))
(command "shell" FN)
)
Note - I used the full path name and not the '~'
0 Likes
Message 3 of 6

Anonymous
Not applicable

You can set your publish options to not open the pdf after creation...

0 Likes
Message 4 of 6

peter_thomson
Advocate
Advocate

Thanks for that. I presume you are on a Win 10 system?

 

I wonder if the fact that you set a variable and then used that in the shell command is enough to make the difference?

 

Will give it a go today.

 

cheers, Peter

0 Likes
Message 5 of 6

peter_thomson
Advocate
Advocate

yes thanks, I am aware of this, however, it is not part of the issue I am trying to solve immediately.

 

regards, Peter

0 Likes
Message 6 of 6

peter_thomson
Advocate
Advocate

Thanks to all for your responses.

 

Looks like DOS is DOS no matter what version of Windows you are running.

Seems like the system I was testing on is faulty.

 

Cheers, Peter

0 Likes