I have an automise script running that starts various dos windows (Basically batch files to do various tasks), I want to be able to tell one from the others so I can kill it if its still running next time the schedule comes up.
Unfortunatly they are all labled as "C:\windows\system32\cmd.exe".
So is there any way to tell them apart or can i assign them IDs or titles when starting them? Back in the VB days shelling out a process would return its window handle - something like that would be nice..
The current release doesn’t expose the ProcessID, however I have just added that and I’ll post here when a build is available with that change included (later today). The processID will only be available through scripting, and only if you are not waiting for the process to complete (it doesn’t make sense to deal with the process id once the process has completed).
So to access it you will need to use some script like this (in the AfterAction script event of the Execute Program Action) :
MyVariable = Action.ProcessID
Note that I’m not sure this is going to solve your problem… in that the process id’s will change each time you run them… so you will have to store those id’s somewhere and then check for them again each time the scheduled task runs… but be careful as the process id may be recycled by windows and be used for other processes.
I found a solution to this (but it may not apply to how you have automise running DOS executes).
I was able to add the “Command line” column to the Window sTask Manager and follow the path to the project that is running at the time. As you know, you can’t get into the project via Automise while it’s running, but you may be able to isolate the ATCMD.exe Images in the Task Manager by going to:
Open Windows Task Manager (on the server you have Automise running)
View > Add Columns
Check off the box marked “Command Line”
This shows the folderpath and file of the Automise Project you have running.