To check a given process is running and if so, kill or terminate it
Posted on 2003-11-11
I would like to create a script that should perform the following:
- The script should accept three parameters, the name of a process, Directory name for the
logfile, and a filename
- It should search for the existence of this process and if it exists, it should stop or kill all
instances of it.
- It should then run a new version of the program, sending output to the specified directory.
The file name should be made up of the supplied filename plus some kind of date identifier
made up of the current system date
planning to execute this script as a Scheduled Job at 12:00 midnight each night. Also this will be scheduled on system startup. The process name which is passed as parameter will be a trace program which generates a log.
Cscript checkProcess.vbs processName, DirectoryName, fileName
I want to run a program called processName and send output to …
After midnight tonight, I want to stop this process and run it again sending output to … DirectoryName\fileName_20031112\log
On system restart it should either append to the existing file for today or recognize that the file exists with today's date and create a new one (E.g. fileName_20031112_01.log)
The operating System is windows 2000 server.
I am newbie for the scripting and would greatly appreciate any help.