Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Batch file to check running process or PID.

Posted on 2004-08-17
3
Medium Priority
?
548 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 500 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 learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

597 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