Author Topic: Why does LTSpice open a new instance (window) for every .asc file I click on?  (Read 6149 times)

0 Members and 1 Guest are viewing this topic.

Offline 741Topic starter

  • Frequent Contributor
  • **
  • Posts: 386
  • Country: gb
    • Circuit & PCB Design (small PCB quantities OK)
It used to be that every .asc file I opened (via Windows Explorer) opened in the same program instance of LTSpice.

Now, annoyingly, a new application instance is created for each file I open in this way.

Yes, I can still navigate from "within" LTSpice - but still, I'd like to be able to use Explorer on occasion.

(Win7 32 bit).

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19517
  • Country: gb
  • 0999
When did this change?

I use LTSpice under WINE and all file open in the same instance, when I load files from the desktop.
 

Offline engrguy42

  • Frequent Contributor
  • **
  • Posts: 656
  • Country: us
Weird. I don't get that (W10). BTW, did you recently get an LTSpice update? Mine updated the other day.

Hold on...

You're using Windows 7 ????????  :scared:

I'm telling Mom...

But seriously, I wonder if that might be the issue.
- The best engineers know enough to realize they don't know nuthin'...
- Those who agree with you can do no wrong. Those who disagree can do no right.
- I'm always amazed at how many people "already knew that" after you explain it to them in detail...
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14465
  • Country: fr
Win 7/64 here, latest LTSpice, and it doesn't do that. It opens files in the same instance each in a new tab.

Could be something specific to the 32-bit version. I guess most of us here on Win 7 or Win 10 run 64-bit versions.

(There doesn't seem to be any option for opening files in new instances or not, so don't bother trying to find this in the control panel dialog...)
 

Offline 741Topic starter

  • Frequent Contributor
  • **
  • Posts: 386
  • Country: gb
    • Circuit & PCB Design (small PCB quantities OK)
It always used to work normally, but has been like this now for a long time, many months. As a guess, I think some system setting is to blame rather than LTSpice itself.

Offline 741Topic starter

  • Frequent Contributor
  • **
  • Posts: 386
  • Country: gb
    • Circuit & PCB Design (small PCB quantities OK)
I re-installed Win 7, and this still happens. I would like it to work like it used to if possible.

Someone else with this same problem here https://groups.io/g/LTspice/topic/open_multiple_asc_files_as/65786364?p=

Offline exe

  • Supporter
  • ****
  • Posts: 2562
  • Country: nl
  • self-educated hobbyist
I'd love to open different files in different windows so I can simulate them independently, and also have more screen real estate. Currently, with two open files when I do simulation the screen is divided between four windows. Each window is to small for me to work efficiently.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Cant you open a second instance of the LTspice executable from the start menu, then open the second sim you want to run concurrently from within it?  That works fine here (Win10 Pro x64, LTspice XVII).

As to the O.P.s problem, either DDE is messed up on their PC :( or the LTspice.Schematic\shell\open\ddeexec subkey in their registry is borked.
Here's a dump of my HKEY_CLASSES_ROOT\LTspice.Schematic key and all subkeys for comparison.
Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\LTspice.Schematic]
@="LTspice Schematic"

[HKEY_CLASSES_ROOT\LTspice.Schematic\DefaultIcon]
@="C:\\Program Files\\LTC\\LTspiceXVII\\XVIIx64.exe,1"

[HKEY_CLASSES_ROOT\LTspice.Schematic\shell]

[HKEY_CLASSES_ROOT\LTspice.Schematic\shell\open]

[HKEY_CLASSES_ROOT\LTspice.Schematic\shell\open\command]
@="\"C:\\Program Files\\LTC\\LTspiceXVII\\XVIIx64.exe\" \"%1\""

[HKEY_CLASSES_ROOT\LTspice.Schematic\shell\open\ddeexec]
@="[open(\"%1\")]"

For those unfamiliar with .reg file syntax and escaping, in Regedit, the LTspice.Schematic\shell\open\ddeexec entry (default) is a String Value (REG_SZ) and reads: [open("%1")]

Followup:
Deleting or renaming the ddeexec sub-key reproduces the O.P's observerd LTspice behaviour: a new LTspice instance is used for each schematic opened from Windows File Explorer.

@exe,
If you open multiple instances of LTspice, and your ddeexec sub-key is valid, File Explorer will open schematics by adding them to the instance that was most recently in-focus.
« Last Edit: September 24, 2020, 09:46:00 am by Ian.M »
 
The following users thanked this post: edavid, exe

Offline 741Topic starter

  • Frequent Contributor
  • **
  • Posts: 386
  • Country: gb
    • Circuit & PCB Design (small PCB quantities OK)
Thank you Ian. I've looked at my registry, and there are no entries at alll for LTSpice under that key. The only entries under HKEY_LOCAL_MACHINE...Uninstall.

I will try adding the keys given...


...Failed unfortunately.

I copied the text into LTSpice.reg, double clicked and imported

Then I exported that key under a new name and compared with WinMerge to confirm they are identical
« Last Edit: September 24, 2020, 01:22:10 pm by 741 »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Caution: I'm using 64 bit windows.  If you are on 32 bit Windows the paths and exe name will be different.

Also HKEY_CLASSES_ROOT is a merged view of system wide + user specific file associations.  DO *NOT* attempt to manually add new keys there! (See https://stackoverflow.com/questions/53984433/hkey-local-machine-software-classes-vs-hkey-classes-root )
Instead its best to  add the required associations with ASSOC and FTYPE in an admin command prompt to make sure the keys go where they should, and only resort to Regedit to set the DefaultIcon and ddeexec keys, searching for where they actually should be (i.e. with the keys generated by ASSOC and FTYPE rather than dumping them in HKEY_CLASSES_ROOT).

If you execute the following in an admin command prompt it will do the bulk of the work for you.  If you make it a .bat or .cmd file remember to double up the % characters!
Code: [Select]
assoc .asc=LTspice.Schematic
assoc .asy=LTspice.Symbol
assoc .cir=LTspice.Netlist
assoc .raw=LTspice.Rawfile
ftype LTspice.Schematic="C:\Program Files\LTC\LTspiceXVII\XVIIx64.exe" "%1"
ftype LTspice.Symbol="C:\Program Files\LTC\LTspiceXVII\XVIIx64.exe" "%1"
ftype LTspice.Netlist="C:\Program Files\LTC\LTspiceXVII\XVIIx64.exe" "%1"
ftype LTspice.Rawfile="C:\Program Files\LTC\LTspiceXVII\XVIIx64.exe" "%1"

Here's all the significant LTspice.<whatever> entries from my HKEY_CLASSES_ROOT so you can check them off as you fix them.
Code: [Select]
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\LTspice.Netlist]
@="LTspice Netlist"

[HKEY_CLASSES_ROOT\LTspice.Netlist\DefaultIcon]
@="C:\\Program Files\\LTC\\LTspiceXVII\\XVIIx64.exe,2"

[HKEY_CLASSES_ROOT\LTspice.Netlist\shell]

[HKEY_CLASSES_ROOT\LTspice.Netlist\shell\open]

[HKEY_CLASSES_ROOT\LTspice.Netlist\shell\open\command]
@="\"C:\\Program Files\\LTC\\LTspiceXVII\\XVIIx64.exe\" \"%1\""

[HKEY_CLASSES_ROOT\LTspice.Netlist\shell\open\ddeexec]
@="[open(\"%1\")]"
[HKEY_CLASSES_ROOT\LTspice.Rawfile]
@="LTspice Rawfile"

[HKEY_CLASSES_ROOT\LTspice.Rawfile\DefaultIcon]
@="C:\\Program Files\\LTC\\LTspiceXVII\\XVIIx64.exe,3"

[HKEY_CLASSES_ROOT\LTspice.Rawfile\shell]

[HKEY_CLASSES_ROOT\LTspice.Rawfile\shell\open]

[HKEY_CLASSES_ROOT\LTspice.Rawfile\shell\open\command]
@="\"C:\\Program Files\\LTC\\LTspiceXVII\\XVIIx64.exe\" \"%1\""

[HKEY_CLASSES_ROOT\LTspice.Rawfile\shell\open\ddeexec]
@="[open(\"%1\")]"

[HKEY_CLASSES_ROOT\LTspice.Schematic]
@="LTspice Schematic"

[HKEY_CLASSES_ROOT\LTspice.Schematic\DefaultIcon]
@="C:\\Program Files\\LTC\\LTspiceXVII\\XVIIx64.exe,1"

[HKEY_CLASSES_ROOT\LTspice.Schematic\shell]

[HKEY_CLASSES_ROOT\LTspice.Schematic\shell\open]

[HKEY_CLASSES_ROOT\LTspice.Schematic\shell\open\command]
@="\"C:\\Program Files\\LTC\\LTspiceXVII\\XVIIx64.exe\" \"%1\""

[HKEY_CLASSES_ROOT\LTspice.Schematic\shell\open\ddeexec]
@="[open(\"%1\")]"

[HKEY_CLASSES_ROOT\LTspice.Symbol]
@="LTspice Symbol"

[HKEY_CLASSES_ROOT\LTspice.Symbol\DefaultIcon]
@="C:\\Program Files\\LTC\\LTspiceXVII\\XVIIx64.exe,11"

[HKEY_CLASSES_ROOT\LTspice.Symbol\shell]

[HKEY_CLASSES_ROOT\LTspice.Symbol\shell\open]

[HKEY_CLASSES_ROOT\LTspice.Symbol\shell\open\command]
@="\"C:\\Program Files\\LTC\\LTspiceXVII\\XVIIx64.exe\" \"%1\""

[HKEY_CLASSES_ROOT\LTspice.Symbol\shell\open\ddeexec]
@="[open(\"%1\")]"
 

Offline 741Topic starter

  • Frequent Contributor
  • **
  • Posts: 386
  • Country: gb
    • Circuit & PCB Design (small PCB quantities OK)
Re: Why does LTSpice open a new instance (window) for every .asc file I click on?
« Reply #10 on: September 24, 2020, 03:40:58 pm »
OK Thanks again.

I am using Win7 64 bit.  I removed the regedit key I'd manually added. Then I ran a cmd file, which resulted in the enties shown in the image.

I exported the netlist key, and got this

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\LTspice.Netlist]

[HKEY_CLASSES_ROOT\LTspice.Netlist\Shell]

[HKEY_CLASSES_ROOT\LTspice.Netlist\Shell\Open]

[HKEY_CLASSES_ROOT\LTspice.Netlist\Shell\Open\Command]
@=hex(2):22,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,00,72,00,61,00,6d,00,20,\
  00,46,00,69,00,6c,00,65,00,73,00,5c,00,4c,00,54,00,43,00,5c,00,4c,00,54,00,\
  73,00,70,00,69,00,63,00,65,00,58,00,56,00,49,00,49,00,5c,00,58,00,56,00,49,\
  00,49,00,78,00,36,00,34,00,2e,00,65,00,78,00,65,00,22,00,20,00,22,00,25,00,\
  31,00,22,00,00,00


That final hex entry looks OK in regedit i.e.
    "C:\Program Files\LTC\LTspiceXVII\XVIIx64.exe" "%1"

But several bits like the key
[HKEY_CLASSES_ROOT\LTspice.Netlist\shell\open\ddeexec]

are absent, so I can try adding those bits manually

steviefaux

  • Guest
Re: Why does LTSpice open a new instance (window) for every .asc file I click on?
« Reply #11 on: September 24, 2020, 03:51:53 pm »
Do you  have a basic knowledge of running Sysinternal Process Monitor? If so, can you run that, then run LTSpice and filter out only its .exe let it run and let it open a new instance, window, stop the trace then upload it somewhere like WeTransfer and then give us all the link so we can take a look. Something in the trace might show why its opening another instance. Maybe some permission denied which is forcing it to open a new instance.
 
The following users thanked this post: 741

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: Why does LTSpice open a new instance (window) for every .asc file I click on?
« Reply #12 on: September 24, 2020, 04:36:17 pm »
The hex stuff is because FTYPE creates values of REG_EXPAND_SZ type rather than REG_SZ that *most* program installers create.  They work much the same (unless you are writing code to handle them) except expansion of environment variables in REG_EXPAND_SZ strings are deferred till they are used.

If you are feeling brave, (and have created a system restore point), you could replace [HKEY_CLASSES_ROOT\ with [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ in the registry snippet I posted, save it as a .reg file and Merge it.  That will put in the same registry entries for the LTspice named file associations as I've got on this Win 10 Pro x64 PC. 

@ any latecomers: The advice above was for the specific English language Windows 7 64 bit the O.P's running version.  YMMV, and expect borkage if you are running non-English, or 32 bit windows or LTspice was installed elsewhere.  Windows 10 borks system restore points so don't expect that to save you!*YOU* *HAVE* *BEEN* *WARNED*
« Last Edit: September 24, 2020, 04:39:49 pm by Ian.M »
 

Offline 741Topic starter

  • Frequent Contributor
  • **
  • Posts: 386
  • Country: gb
    • Circuit & PCB Design (small PCB quantities OK)
Re: Why does LTSpice open a new instance (window) for every .asc file I click on?
« Reply #13 on: September 25, 2020, 08:03:17 am »
WeTransfer looks like a useful site,  here's the link to the LT monitor
https://we.tl/t-MnTScaBSlM

Offline 741Topic starter

  • Frequent Contributor
  • **
  • Posts: 386
  • Country: gb
    • Circuit & PCB Design (small PCB quantities OK)
First I un-installed, then I installed the latest vesion, no change.

Then I updated the posted reg file (using the HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ substitution) and the import worked.

Finally I tried agin, and still the same issue whereby every .asc I click on launches a new window.

I also tried removing the old HKEY_CLASSES_ROOT\LTspice.Netlist entries, but that made no difference.

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Sorry to hear that.  Are you experiencing any issues with DDE and any other programs?
 

steviefaux

  • Guest
Strange. Installed on Windows 10 and I get same issue, installed on Windows 7 64bit and it doesn't do it.

Time to check the Process Monitor logs on both.
 

steviefaux

  • Guest
One way round it at moment which is annoying is when the window is small, dragging the .asc into the LTSpice window which then keeps it in the same running process.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf