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


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

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-22 09:32 +0100
Organization Aioe.org NNTP Server
Message-ID <t3tp6t$1njd$1@gioia.aioe.org> (permalink)
References (1 earlier) <20220421204315.03ff044cdeef898a513382f1@127.0.0.1> <t3sgg5$j9f$1@gioia.aioe.org> <t3sk11$1snj$1@gioia.aioe.org> <t3sv4a$1489$1@gioia.aioe.org> <t3tfe4$1o5j$1@gioia.aioe.org>

Cross-posted to 3 groups.

Show all headers | View raw


Herbert Kleebauer wrote:

>>> If you don't want that the CMD windows stays open, then use "start scrcpy".
>> 
>> Hmmmmm.... gonna have to look that one up... and test to see if that works.
> 
> start /?

I think perhaps this task of killing the window is harder than it seems to be.

I ran that and I referenced all the online manpages; however, I haven't
_understood_ yet all the options, nor have I figured out which will work.

> Why don't you just try your command with an added "start" before "scrcpy":
> %comspec% /c 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

Well, that _was_ the first thing I had tried; but all it did when I tried it
was _add_ another command window (which closed instantly); but otherwise
there was no change (in that what's left is the command window & the Android mirror).
 
> If the CMD window still doesn't close, add a "&cls&exit"

I think it may be harder to do than it at first appears to be.

%comspec% /c 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
%comspec% /c 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 & exit
%comspec% /c cd /d "c:\app\editor\android\scrcpy" & adb connect 192.168.0.2:5555 & cls & start scrcpy --always-on-top --tcpip=192.168.0.2:5555 & cls & exit
Unfortunately they still left the command window the same as before.

What they apparently killed was the penultimate adb server window 
(whose standard out used to be combined with the scrcpy window apparently).

However clearing the screen and exiting _again_ didn't solve that issue
of the lingering command window when run from the "Run" icon:
%comspec% /c cd /d "c:\app\editor\android\scrcpy" & adb connect 192.168.0.2:5555 & cls & start scrcpy --always-on-top --tcpip=192.168.0.2:5555 & cls & exit & cls & exit
%comspec% /c 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 & cls & exit
%comspec% /c 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 & exit

It's interesting that with the &cls&exit, the adb output is missing; 
but it still doesn't prevent the command window from lingering. Sigh.
-- 
 &    separates commands on a line.
 &&   executes this command only if previous command's errorlevel is 0.
 ||   (not used above) executes this command only if previous command's errorlevel is NOT 0
 >    output to a file
 >>   append output to a file
 <    input from a file
 |    output of one command into the input of another command
 ^    escapes any of the above, including itself, if needed to be passed to a program
 "    parameters with spaces must be enclosed in quotes
 +    used with copy to concatenate files. E.G. copy file1+file2 newfile
 ,    used with copy to indicate missing parameters. This updates the files modified date. E.G. copy /b file1,,
 %variablename% a inbuilt or user set environmental variable
 !variablename! a user set environmental variable expanded at execution time, turned with SetLocal EnableDelayedExpansion command
 %<number> (%1) the nth command line parameter passed to a batch file. %0 is the batchfile's name.
 %* (%*) the entire command line.
 %<a letter> or %%<a letter> (%A or %%A) the variable in a for loop. Single % sign at command prompt and double % sign in a batch file.

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