Solved

Batch file to check running process or PID.

Posted on 2004-08-17
3
518 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

815 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now