Solved

Batch file to check running process or PID.

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 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