PC Review


Reply
Thread Tools Rate Thread

create this batch

 
 
tandemino
Guest
Posts: n/a
 
      28th Jan 2005
hi all
I want to create this batch file :

if (a.exe run) then (stop a.exe)
else (run b.exe)

where a.exe and b.exe are generic program

thanks all

--


__________________________________________
For reply to email
remove" togli_nospam"


Inviato da www.mynewsgate.net
 
Reply With Quote
 
 
 
 
Matthias Tacke
Guest
Posts: n/a
 
      29th Jan 2005
tandemino wrote:
> hi all
> I want to create this batch file :
>
> if (a.exe run) then (stop a.exe)
> else (run b.exe)
>
> where a.exe and b.exe are generic program
>


So you need tools to list/kill running programs/processes

The support tools for w2k have tlist/kill,
XP has tasklist/taskkill
The free pstools from http://www.sysinternals.com contain pslist/pskill.
The also free cmdow from http://www.commandline.co.uk can do both.

Since the options and the output of the tools varies, you should
state your os and preferrence.

HTH

--
Gruesse Greetings Saludos Saluti Salutations
Matthias
---------+---------+---------+---------+---------+---------+---------+
 
Reply With Quote
 
Jerold Schulman
Guest
Posts: n/a
 
      29th Jan 2005
On Fri, 28 Jan 2005 23:33:20 GMT, "tandemino" <(E-Mail Removed)> wrote:

>hi all
>I want to create this batch file :
>
>if (a.exe run) then (stop a.exe)
>else (run b.exe)
>
>where a.exe and b.exe are generic program
>
>thanks all



See tip 4010 and links in the 'Tips & Tricks' at http://www.jsiinc.com

Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
 
Reply With Quote
 
Bob
Guest
Posts: n/a
 
      2nd Feb 2005

Unless it is not an option for you, VBScript may be a good option. The
below is based on my simple "Kill Process If Running" script at
http://www.adminscripteditor.com/scr...iew.asp?id=443

There are also similar KiXtart functions at:
http://www.adminscripteditor.com/scr...iew.asp?id=145
http://www.adminscripteditor.com/scr...iew.asp?id=146



KillProcess = "a.exe"

Set Shell = CreateObject("WScript.Shell")
Set ProcessList =
GetObject("winmgmts://.").InstancesOf("win32_process")

For Each Process In ProcessList
If Process.Name = KillProcess Then
Process.Terminate
ProcessKilled = "True"
End If
Next

If ProcessKilled <> "True"
Shell.Run ("b.exe")
End If





tandemino wrote:
> hi all
> I want to create this batch file :
>
> if (a.exe run) then (stop a.exe)
> else (run b.exe)
>
> where a.exe and b.exe are generic program
>
> thanks all
>
> --
>
>
> __________________________________________
> For reply to email
> remove" togli_nospam"
>
>
> Inviato da www.mynewsgate.net


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create Batch log =?Utf-8?B?b21pcg==?= Windows XP Help 0 13th Feb 2007 10:08 PM
Batch File Help (To Create) =?Utf-8?B?TGVvbmFyZCBXLiBQZWFjb2Nr?= Windows XP General 4 13th Sep 2006 08:58 PM
Going away need to create Batch file gavbam Windows XP 5 26th Jul 2006 07:02 AM
Trying to create a batch file =?Utf-8?B?VGltVA==?= Microsoft Access 1 19th Jun 2005 01:41 PM
Create a batch file? Louise Windows XP Configuration 10 3rd Feb 2005 08:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:07 PM.