home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch.nt      Fun with Windows NT batch files      68,980 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 66,988 of 68,980   
   Zaidy036 to novice   
   Re: Tasklist and PID   
   29 Jul 17 17:28:44   
   
   From: Zaidy036@isp.spam   
      
   On 7/29/2017 7:09 AM, novice wrote:   
   > Hello   
   >   
   > I need help, I don't know, how to do this.   
   >   
   > I have a batch what running long time and I don't want to watch when it stop   
   > and I want to run another batch after that first batch stop, I think to make   
   > another batch, what use tasklist command.   
   >   
   > (I know, I can start two batch like this first.cmd & second.cmd, but this   
   > situation are when first is already running and you want to run second batch   
   > after first and you don't want to cancel first batch).   
   >   
   > Command example; Tasklist /NH /FI "pid eq 4952" found that specific batch,   
   > what is running. It's use robocopy, so I cant use imagename with tasklist,   
   > because next batch will use robocopy too. I want to create batch, what check   
   > if this specific PID running. If it's running, nothing happend. If this PID   
   > is not found anymore, I want to start second batch.   
   >   
   > Example;   
   > @Echo off   
   > :start   
   > timeout /t 600   
   > tasklist /NH /FI "pid eq 4952"   
   > "something if or loop trick here or little bit earlier, what check is that   
   > PID running"   
   > if running => goto start   
   > call second_batch.cmd (if specific PID is not running, that call will be   
   > executed)   
   > :end   
   >   
   >   
      
   *** All in one batch:   
   for the first RoboCopy use START "" /WAIT RoboCopy ....   
   for the second RoboCopy use START "" RoboCopy ...   
      
   - or -   
      
   *** Using two batches:   
   in the first batch use START "" /WAIT RoboCopy ....   
   then for the second batch use START "" [path to second batch]   
      
   --- 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