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 41,881 of 42,547   
   Arlen Holder to All   
   Re: What syntax combines 2 commands into   
   01 Sep 20 06:07:21   
   
   XPost: alt.comp.os.windows-10, comp.os.msdos.programmer, alt.comp.freeware   
   From: arlen_holder@newmachines.com   
      
   QUESTION about TARGET multi-line-command syntax   
      
   1. This works from the Windows command line to kill all the users' tasks:   
      Win+R > cmd {ctrl+shft+enter} >   
        taskkill /f /fi "USERNAME eq %COMPUTERNAME%\%USERNAME%" /IM *   
      
   2. That also seems to work just fine from a shortcut TARGET line:   
      TARGET = taskkill /f /fi "USERNAME eq %COMPUTERNAME%\%USERNAME%" /IM *   
      START IN: C:\Windows\system32   
      
   3. It also seems to work in a comspec cmd (needed for multiple commands):   
      TARGET = %comspec% /c taskkill /f /fi "USERNAME eq %COMPUTERN   
   ME%\%USERNAME%" /IM *   
      START IN: C:\Windows\system32   
      
   4. But it doesn't seem to work in multi-command shortcut comspec syntax:   
      TARGET = %comspec% /c "echo off | clip" & veracrypt /dismount /force /q &   
   taskkill /f /fi "USERNAME eq %COMPUTERNAME%\%USERNAME%" /IM *   
      START IN: C:\Windows\system32   
      
   Q: What syntax change is needed to get that multi-line comspec cmd to work?   
      
   See also:   
   o Tutorial for creating cclip & killall clearing the Windows clipboard &   
   killing users' tasks in one fell swoop   
        
   --   
   Sometimes you need just a little bit of syntactical help to get it working.   
      
   --- 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