1336: call of Everything, no longer returns to prompt

Discussion related to "Everything" 1.5 Alpha.
Post Reply
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

1336: call of Everything, no longer returns to prompt

Post by therube »

1336:
a call of Everything, no longer returns to the command prompt (until Everything is closed)

SSSLX.bat: no longer "returns" (until E is closed)...
Not what was happening. (Must not have been.) See below... instead.

Code: Select all

originally (12-18) i had
start /B  cmd /C   "C:\DEV\Locate\15.filelist\Everything.exe"   -instance FILELIST  -new-window        -s*  %XES%
but then (on 1-15) i changed it to (only)
                   "C:\DEV\Locate\15.filelist\Everything.exe"   -instance FILELIST  -new-window        -s*  %XES%
But with 1336 I need to go back to the former in order to have Everything open, & return back to my command prompt

C:\> set XES=cat "yellow stripe"
C:\> SET XES
C:\> XES=cat "yellow stripe"
C:\> SSSLX.bat


one downside (& you know now i hate "quotes") is that with the former
is that SSSLX.bat worked fine with %XES% (as above)

where with 1336, now needing (?) start /b cmd /c
SSSLX.bat fails: The system cannot find the path specified.

if XES=cat yellow stripe (without the "quotes"), then SSSLX works,
but with "quotes", it fails

(do i need both start /B & cmd /C ?
when i first started messing, it seemed so, but then with later revisions i was able to drop those parts)
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: 1336: call of Everything, no longer returns to prompt

Post by NotNull »

but then (on 1-15) i changed it to (only)
"C:\DEV\Locate\15.filelist\Everything.exe" -instance FILELIST -new-window -s*
I doubt if this ever worked as you intended. This will keep the CMD window open until Everything is exited.


Try this instead:

Code: Select all

 start "" "C:\DEV\Locate\15.filelist\Everything.exe"   -instance FILELIST  -new-window        -s*
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: 1336: call of Everything, no longer returns to prompt

Post by therube »

OK, the reason it worked (in <1336) is because an existing Everything window was initially opened.

So if you open 1 window, then run SSSLX.bat, that opens a second window & with that (& with no START), control does then drop right back to the command prompt (as wanted).

(Let me throw 1336 in here...)


And 1336 is (now) working just fine... ?

I guess, I must not have had an initial window open (that is possible) when I first noticed this.
And of course I noticed it right after putting in 1336... because I would have closed all other windows, first.


Now, why behavior is different, i.e., why my (newer version of) batch file works as wanted - if there is an already open initial window... I'll have to stew on it?
therube
Posts: 4955
Joined: Thu Sep 03, 2009 6:48 pm

Re: 1336: call of Everything, no longer returns to prompt

Post by therube »

Try this instead:
start "" "C:\DEV\Locate\15.filelist\Everything.exe" -instance FILELIST -new-window -s*
Yeah, that's fine (I'll have to double check) even without any open window.


Wonder why I didn't try that at the time (as I use that too in other batch files).

Code: Select all

:: MOZpHERE (aka MOZ_HERE) open Mozilla with arbitrary PROFILE, HERE (in current directory)

@echo off
echo "Open MOZILLA starting with a (new or otherwise) PROFILE in: "
PWD
pause

set MOZ_NO_REMOTE=1
if exist "C:\WLIB\Mozilla\SeaMonkey\seamonkey.exe" start "" "C:\WLIB\Mozilla\SeaMonkey\seamonkey.exe" -profile . -no-remote %1
if exist "C:\WLIB\Mozilla\MOZILLA\mozilla.exe" start "" "C:\WLIB\Mozilla\MOZILLA\mozilla.exe" -p "dumy"
set MOZ_NO_REMOTE=0

Code: Select all

SET      XDIRNAME="%CD%"
SET
PAUSE

START "" C:\DEV\DUPLICATE\AllDup_commandline\AllDupPortable.exe %XDIRNAME%
EXIT

Code: Select all

:: Everything Rename "stand-alone" or "SendTo" or ...

:: Requires >= Everything 1.4.1.791
:: Requires a minimum of 2 files
:: Might run into an ~2048 command line character length limitation
:: http://stackoverflow.com/questions/3205027/maximum-length-of-command-line-string

:: SjB 11/04/2016


echo %*
echo %* > C:\DEV\Locate\Everything_Rename\dumy

pause

START "" C:\DEV\Locate\Everything_Rename\Everything.exe -rename %*
NotNull
Posts: 5458
Joined: Wed May 24, 2017 9:22 pm

Re: 1336: call of Everything, no longer returns to prompt

Post by NotNull »

therube wrote: Fri Feb 03, 2023 7:39 pm I'll have to stew on it?
We don't want that to happen!!

When Everything is not running:
starting Everything.exe will start a new child process and your bat file will wait until that process no longer exists to execute the rest of the comnmands in that script/ return to the prompt.


When Everything is already running:
starting Everything.exe will not be able to start a new child process as there is already an Everything.exe running that will handle the task [1]. So no longer a child-process and therefor the script will continue with the remainder of the commands / return to the prompt.

[1] That is Everything specific; it likes to have 1 process running. Other applications can behave differently (cmd.exe for example)
void
Developer
Posts: 16671
Joined: Fri Oct 16, 2009 11:31 pm

Re: 1336: call of Everything, no longer returns to prompt

Post by void »

As you have found:

If Everything was not running, calling Everything.exe will block until Everything exits.
If Everything was running, calling Everything will pass the command line to the existing instance and this call returns immediately.

Use the new -wait command line option if you want the call to block until Everything exits. (even if Everything wasn't running)
-or-
Use
START "" Everything.exe
to return from the call immediately.
Post Reply