home bbs files messages ]

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,023 of 42,547   
   Andy Burnelli to Herbert Kleebauer   
   Re: Is there a way to put a command wind   
   22 Apr 22 09:32:44   
   
   XPost: alt.comp.os.windows-10, alt.comp.microsoft.windows   
   From: spam@nospam.com   
      
   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    
   92.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    
   92.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    
   92.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    
   92.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   
    % (%1) the nth command line parameter passed to a batch file. %0 is   
   the batchfile's name.   
    %* (%*) the entire command line.   
    % or %% (%A or %%A) the variable in a for loop. Single %   
   sign at command prompt and double % sign in a batch file.   
      
   --- 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