Problem with automating LTSpice

ltspicesimulation

I'm trying to automate LTSpice using the command line. I have tried the following command several times:

test.asc -run -b

However, it only opens my schematic in LTSpice and does not run it! I have no idea whats wrong with it. The schematic is a very simple circuit which should be run in less than a second. Does any one have idea? How should I resolve this issue?

Thanks

Best Answer

The command "test.asc -run -b" does not run LTSpice, it simply opens the file "test.asc". It only opens in LTSpice because the file association for ".asc" is assigned to LTSpice in the operating system (if it was assigned to eg. notepad then it would open in that program instead). The ".asc" filetype is set up to only pass the file name to LTSpice, not the whole command line.

Your command should start with the name of the executable you want to run ie. "scad3.exe", followed by any parameters you want to give it ie. "test.asc -run -b". LTSpice will then be able to read the full command line, run the simulation and produce the expected output files ("test.log", "test.net").