Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.comp.os.windows-10 > #159036

Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)?

From Andy Burnelli <spam@nospam.com>
Newsgroups alt.comp.os.windows-10, alt.msdos.batch, alt.comp.microsoft.windows
Subject Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)?
Date 2022-04-23 13:36 +0100
Organization Aioe.org NNTP Server
Message-ID <t40rr2$93a$1@gioia.aioe.org> (permalink)
References (5 earlier) <t3tfe4$1o5j$1@gioia.aioe.org> <t3tp6t$1njd$1@gioia.aioe.org> <t3u478$tfu$1@gioia.aioe.org> <t3v6h6$ol9$1@gioia.aioe.org> <t408to$pcd$1@gioia.aioe.org>

Cross-posted to 3 groups.

Show all headers | View raw


Herbert Kleebauer wrote:

>> Note that brings up two windows, one of which is the mirrored
>> Android window, and the other of which is the "scrcpy.exe" command window:
> 
> Then scrcpy.exe uses both, a GUI window and a console. 
> But that has nothing to do with the CMD window.

Everything you said is correct. 
Hence I apologize for being confused prior. Thank you for clarifying. 

You (and Andy Burns) know more about Windows & command actions than I ever
will know, so I sincerely want to thank you for your kind-hearted help.

You are right. I was wrong. I ran all your tests (see below) and they worked
_exactly_ as you surmised they would.

> You can't close this console because
> the program needs it (maybe for some status or error output).

Yes. You are correct. I will give up on trying to close the "scrcpy console"
as the developers, for whatever reason, _want_ it to remain visible.

It's rare for me to fail to wrest control of Windows, but in this case, I
will admit defeat in that I can't get rid of that "scrcpy console" window
(other than to iconify it).

> If you start scrcpy.exe by a mouse click, both windows should be created.

You are correct. 
The total number of windows depends on _how_ I run the command.

1. There is whatever "thing" the command is run inside of
   a. That can be a CMD window
   b. That can be a RUN box
   c. That can be a shortcut TARGET
2. Then there is the "scrcpy console" window.
3. And then there is the resulting Android GUI.

As you correctly surmised, depending on _where_ I execute the scrcpy
command, the result could be two or three windows; but in every case, I
can't "kill" the scrcpy console (which was my original goal).

> If you start it within a CMD window, scrcpy.exe should use the CMD
> window as console, so no new console is created and CMD is suspended until
> scrcpy.exe is closed. 

This is correct.

Here is a step-by-step test with the phone on the Wi-Fi network.
A. Run > cmd
B. ping 192.168.0.2 (just to ensure the TCP/IP connection is alive)
C. cd c:\app\editor\android\scrcpy
D. adb kill-server (this gives me a known baseline starting point)
E. adb connect 192.168.0.2:5555 (this returns me to the cmd prompt)
F. scrcpy (the CMD window turns into a scrcpy console)

As you correctly surmised, that does _two_ things:
1. The "scrcpy" console takes over the CMD window.
2. The Android GUI pops up

Then, when I press the Windows [x] box in the Android GUI...
1. That [x] kills the Android GUI window
2. And it kills the scrcpy process in the CMD window
3. Which gets me back the command prompt in the CMD window

> If you start it with "start scrcpy.exe" in a cmd
> window, then a new console is created and CMD get control back over its
> console immediately.

You are correct.

Here is a step-by-step test with the phone on the Wi-Fi network.
A. Run > cmd
B. ping 192.168.0.2 
C. cd c:\app\editor\android\scrcpy
D. adb kill-server 
E. adb connect 192.168.0.2:5555 (this returns me to the cmd prompt)
F. start scrcpy (this opens up a _separate_ scrcpy console)

That does _three_ things:
1. It opens up a _new_ console for the "scrcpy" output.
2. The Android GUI pops up
3. And it returns me to the cmd prompt in the cmd window
   (I can close that command window without affecting anything else.)

Likewise, three windows open up if I put this in a shortcut TARGET:
TARGET=%comspec% /k cd /d "c:\app\editor\android\scrcpy" && adb connect 192.168.0.2:5555 && start scrcpy --always-on-top --tcpip=192.168.0.2:5555
a. It opens a cmd window 
b. It opens a separate scrcpy console
c. It opens the Android GUI

The cmd window can be killed separately but killing either the Android GUI
or the scrpcpy console will kill both.

Lastly, this opens up three windows but instantly kills one of them: 
TARGET=%comspec% /k cd /d "c:\app\editor\android\scrcpy" && adb connect 192.168.0.2:5555 && start scrcpy --always-on-top --tcpip=192.168.0.2:5555 &cls&exit
a. It opens a cmd window 
b. It opens a separate scrcpy console
c. It opens the Android GUI
d. Then it kills the cmd window

In summary, you were always correct and I was confused - but in the end, I
agree with you on everything you've tried to help me to understand.

The net is that I can't easily get rid of the scrcpy console.
Thanks for your kind help and advice.

Back to alt.comp.os.windows-10 | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-21 18:42 +0100
  Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? "Kerr-Mudd, John" <admin@127.0.0.1> - 2022-04-21 20:43 +0100
    Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-21 21:57 +0100
      Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Herbert Kleebauer <klee@unibwm.de> - 2022-04-21 23:57 +0200
        Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-22 02:07 +0100
          Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-22 02:18 +0100
          Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Herbert Kleebauer <klee@unibwm.de> - 2022-04-22 07:45 +0200
            Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-22 09:32 +0100
              Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burns <usenet@andyburns.uk> - 2022-04-22 10:23 +0100
                Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? MikeS <MikeS@fred.com> - 2022-04-22 13:06 +0100
                Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? "Kerr-Mudd, John" <admin@127.0.0.1> - 2022-04-22 13:28 +0100
              Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Herbert Kleebauer <klee@unibwm.de> - 2022-04-22 13:40 +0200
                Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-22 22:26 +0100
                Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Herbert Kleebauer <klee@unibwm.de> - 2022-04-23 09:12 +0200
                Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-23 13:36 +0100
                Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Herbert Kleebauer <klee@unibwm.de> - 2022-04-23 17:04 +0200
                Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Herbert Kleebauer <klee@unibwm.de> - 2022-04-23 17:07 +0200
                Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-23 20:13 +0100
                Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Herbert Kleebauer <klee@unibwm.de> - 2022-04-23 17:15 +0200
                Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-23 17:53 +0100
                Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-23 17:22 +0100
                Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-29 17:49 +0100
  Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-23 14:17 +0100
    Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-23 14:25 +0100
  Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Robert Roland <fake@ddress.no> - 2022-04-23 15:46 +0200
    Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-23 15:59 +0100
      Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Robert Roland <fake@ddress.no> - 2022-04-24 00:34 +0200
        Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-24 04:09 +0100
          Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Herbert Kleebauer <klee@unibwm.de> - 2022-04-24 18:07 +0200
            Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-25 01:06 +0100
    The various kinds of Windows applications... (Was: Is there a way to put a command window in the background like Linux does (so that you can kill it)?) gazelle@shell.xmission.com (Kenny McCormack) - 2022-04-24 12:44 +0000
      Re: The various kinds of Windows applications... (Was: Is there a way to put a command window in the background like Linux does (so that you can kill it)?) Andy Burnelli <spam@nospam.com> - 2022-04-27 12:14 +0100
  Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? "Mr. Man-wai Chang" <toylet.toylet@gmail.com> - 2022-04-24 00:19 +0800
    Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-29 16:54 +0100
  Re: Is there a way to put a command window in the background like Linux does (so that you can kill it)? Andy Burnelli <spam@nospam.com> - 2022-04-27 12:19 +0100

csiph-web