Solved

Batch file to check running process or PID.

Posted on 2004-08-17
3
526 Views
Last Modified: 2013-12-03
I am writing a quick batch program and want to know how to have it check and see if a certain process has completed, before it runs. I'm in Windows 2000.

For instance, I want to tell the .bat to check and see if "ntbackup.exe" is running on the PC.  If it is running, then exit out of the batch file. If it is not running, then do commands xxx yyy zzzz.

-thanks all
Bob
0
Comment
Question by:ZabagaR
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 8

Accepted Solution

by:
mxjijo earned 125 total points
ID: 11825363

Bob, Windows being a GUI based OS, there are no "standard" windows commands to list the running processes.
However there are several command line tools available to list the running processes. Sysinternal's pslist.exe for example

http://www.sysinternals.com/ntw2k/freeware/pstools.shtml 

lists out the running processes.

Once you get the porcess list I hope you know how to write the rest of the batch script.

0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question