How to Quit\Exit a Named Instance

If you are experiencing problems with "Everything", post here for assistance.
Post Reply
DanoLeMano
Posts: 8
Joined: Sat Jul 17, 2021 10:30 pm

How to Quit\Exit a Named Instance

Post by DanoLeMano »

Here is VBA code that I use to launch a Named Instance incorporating the Environ("USERNAME") variable:

Code: Select all

myPath = "C:\Program Files (x86)\Everything\Everything.exe -admin -startup -instance """ & Environ("USERNAME") & """"
Shell myPath, vbNormalFocus
This code works perfectly and loads the correct Everything-daniel.ini file and I can see the name of the instance in the Everything search window caption:
everything named instance.GIF
everything named instance.GIF (12.96 KiB) Viewed 3845 times
The problem I am having is that I can't seem to Quit or Exit this instance using this code which previously worked before I added the Named Instance:

Code: Select all

C = "Everything.exe -quit"                
Set w = CreateObject("WScript.Shell")
w.CurrentDirectory = "C:\Program Files (x86)\Everything\"
w.Run C, 0, True 
Why does this code not quit the Named Instance? Is there different required syntax to close a Named Instance? Maybe I need to reference the Named Instance with the -quit command?
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: How to Quit\Exit a Named Instance

Post by therube »

If you combine the -quit with the -instance name, does that work?
So something like,
Everything.exe -quit -instance """ & Environ("USERNAME") & """
DanoLeMano
Posts: 8
Joined: Sat Jul 17, 2021 10:30 pm

Re: How to Quit\Exit a Named Instance

Post by DanoLeMano »

I was just about to post and say that your suggestion worked, but unfortunately it did not work for me. Interestingly, your suggestion to reference the Named Instance along with the -quit parameter worked to close an unnamed instance, but it does not work for my Named Instance.
void
Developer
Posts: 16678
Joined: Fri Oct 16, 2009 11:31 pm

Re: How to Quit\Exit a Named Instance

Post by void »

The following worked for me:

Code: Select all

C = "Everything.exe -quit -instance """ & Environ("USERNAME") & """"               
Set w = CreateObject("WScript.Shell")
w.CurrentDirectory = "C:\Program Files (x86)\Everything\"
w.Run C

Please check the command line Everything receives with:

Code: Select all

C = "Everything.exe -debug -instance """ & Environ("USERNAME") & """"          
What is shown in the debug console at the top for cmdline?
DanoLeMano
Posts: 8
Joined: Sat Jul 17, 2021 10:30 pm

Re: How to Quit\Exit a Named Instance

Post by DanoLeMano »

Thank you, your suggestion for how to -quit a Named Instance worked perfectly.
Post Reply