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,986 of 68,980    |
|    novice to All    |
|    Tasklist and PID    |
|    29 Jul 17 14:09:54    |
      From: novice@invalid.fi.inv              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              --- 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