Forums before death by AOL, social media and spammers... "We can't have nice things"
|    alt.msdos.batch    |    Fun with MS-DOS batch files    |    42,547 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 42,020 of 42,547    |
|    Andy Burnelli to John    |
|    Re: Is there a way to put a command wind    |
|    21 Apr 22 21:57:55    |
   
   XPost: alt.comp.os.windows-10, alt.comp.microsoft.windows   
   From: spam@nospam.com   
      
   Kerr-Mudd, John wrote:   
      
   >> That reliably pops up the Android screen on Windows over Wi-Fi but then I   
   >> have absolutely no need for the command window to remain around as clutter.   
   >>   
   >   
   > So why put in the parameter '/k'?   
      
   Good question.   
      
   The /k is mostly habit but it doesn't matter as you must use either /K or /C   
   and both do the exact same thing with respect to the window staying open.   
      
   %comspec% /c cd /d "c:\app\editor\android\scrcpy" && adb connect   
   192.168.0.2:5555 && scrcpy --always-on-top --tcpip=192.168.0.2:5555   
      
   As a direct result of your query, I changed it to /c (you must use one or   
   the other as far as I know), but I knew it wouldn't matter as I've had this   
   problem for decades. I just never tried to resolve it until now.   
      
   The way Linux gets around it is the put the command in the background.   
   But I don't know how to put a Windows command in the background.   
      
   Does anyone know how to background a Windows command?   
      
   There might be something in the help for comspec though on the Linux-like   
   use of ampersand (&) to put the process into the background so that the   
   initiating command window can subsequently be closed.   
    %comspec% /? > comspec.man (See output in the sig.)   
      
   >> Is there a way to get rid of the command Window and not kill the process?   
   >   
   > Just never open it in the first place?   
      
   That would work if I knew how to run a command without ever opening a   
   command window. How is that done for the screen copy command shown above?   
   --   
   %comspec% /? > comspec.man   
      
   Starts a new instance of the Windows command interpreter   
      
   CMD [/A | /U] [/Q] [/D] [/E:ON | /E:OFF] [/F:ON | /F:OFF] [/V:ON | /V:OFF]   
    [[/S] [/C | /K] string]   
      
   /C Carries out the command specified by string and then terminates   
   /K Carries out the command specified by string but remains   
   /S Modifies the treatment of string after /C or /K (see below)   
   /Q Turns echo off   
   /D Disable execution of AutoRun commands from registry (see below)   
   /A Causes the output of internal commands to a pipe or file to be ANSI   
   /U Causes the output of internal commands to a pipe or file to be   
    Unicode   
   /T:fg Sets the foreground/background colors (see COLOR /? for more info)   
   /E:ON Enable command extensions (see below)   
   /E:OFF Disable command extensions (see below)   
   /F:ON Enable file and directory name completion characters (see below)   
   /F:OFF Disable file and directory name completion characters (see below)   
   /V:ON Enable delayed environment variable expansion using ! as the   
    delimiter. For example, /V:ON would allow !var! to expand the   
    variable var at execution time. The var syntax expands variables   
    at input time, which is quite a different thing when inside of a FOR   
    loop.   
   /V:OFF Disable delayed environment expansion.   
      
   Note that multiple commands separated by the command separator '&&'   
   are accepted for string if surrounded by quotes. Also, for compatibility   
   reasons, /X is the same as /E:ON, /Y is the same as /E:OFF and /R is the   
   same as /C. Any other switches are ignored.   
      
   If /C or /K is specified, then the remainder of the command line after   
   the switch is processed as a command line, where the following logic is   
   used to process quote (") characters:   
      
    1. If all of the following conditions are met, then quote characters   
    on the command line are preserved:   
      
    - no /S switch   
    - exactly two quote characters   
    - no special characters between the two quote characters,   
    where special is one of: &<>()@^|   
    - there are one or more whitespace characters between the   
    two quote characters   
    - the string between the two quote characters is the name   
    of an executable file.   
      
    2. Otherwise, old behavior is to see if the first character is   
    a quote character and if so, strip the leading character and   
    remove the last quote character on the command line, preserving   
    any text after the last quote character.   
      
   If /D was NOT specified on the command line, then when CMD.EXE starts, it   
   looks for the following REG_SZ/REG_EXPAND_SZ registry variables, and if   
   either or both are present, they are executed first.   
      
    HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun   
      
    and/or   
      
    HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun   
      
   Command Extensions are enabled by default. You may also disable   
   extensions for a particular invocation by using the /E:OFF switch. You   
   can enable or disable extensions for all invocations of CMD.EXE on a   
   machine and/or user logon session by setting either or both of the   
   following REG_DWORD values in the registry using REGEDIT.EXE:   
      
    HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\EnableExtensions   
      
    and/or   
      
    HKEY_CURRENT_USER\Software\Microsoft\Command Processor\EnableExtensions   
      
   to either 0x1 or 0x0. The user specific setting takes precedence over   
   the machine setting. The command line switches take precedence over the   
   registry settings.   
      
   In a batch file, the SETLOCAL ENABLEEXTENSIONS or DISABLEEXTENSIONS   
   arguments   
   takes precedence over the /E:ON or /E:OFF switch. See SETLOCAL /? for   
   details.   
      
   The command extensions involve changes and/or additions to the following   
   commands:   
      
    DEL or ERASE   
    COLOR   
    CD or CHDIR   
    MD or MKDIR   
    PROMPT   
    PUSHD   
    POPD   
    SET   
    SETLOCAL   
    ENDLOCAL   
    IF   
    FOR   
    CALL   
    SHIFT   
    GOTO   
    START (also includes changes to external command invocation)   
    ASSOC   
    FTYPE   
      
   To get specific details, type commandname /? to view the specifics.   
      
   Delayed environment variable expansion is NOT enabled by default. You   
   can enable or disable delayed environment variable expansion for a   
   particular invocation of CMD.EXE with the /V:ON or /V:OFF switch. You   
   can enable or disable delayed expansion for all invocations of CMD.EXE on a   
   machine and/or user logon session by setting either or both of the   
   following REG_DWORD values in the registry using REGEDIT.EXE:   
      
    HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\DelayedExpansion   
      
    and/or   
      
    HKEY_CURRENT_USER\Software\Microsoft\Command Processor\DelayedExpansion   
      
   to either 0x1 or 0x0. The user specific setting takes precedence over   
   the machine setting. The command line switches take precedence over the   
   registry settings.   
      
   In a batch file the SETLOCAL ENABLEDELAYEDEXPANSION or   
   DISABLEDELAYEDEXPANSION   
   arguments takes precedence over the /V:ON or /V:OFF switch. See SETLOCAL /?   
   for details.   
      
   If delayed environment variable expansion is enabled, then the exclamation   
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca