Question
· Nov 20, 2018

Run batch script from Task Manager

Good morning,

Background to task: Shut down Ensemble from a task in Task Manager.

I have a batch file that shuts down Ensemble when run as administrator. I can confirm this works, as it brings up the shutdown/restart prompt for Ensemble, however I now need to plug this into Ensemble's Task Scheduler so it can be run on-demand.

At present I am trying to use: do ^execute: %windir%\system32\cmd.exe Z:\Scripts\shutdown.lnk

This is to run the batch file from the shortcut, which runs it as admin. I get a syntax error, which I am not surprised to see, so could I have some advice on how to code this better? Alternatively, if anyone has any better ideas to shutdown Ensemble from Task Manager I am open to suggestions.

Many thanks and kind regards, Alexi Demetriou

Discussion (19)2
Log in or sign up to continue

batch file means, that you want to do it outside of Ensemble. In this case you should use ccontrol command or iris if you use IRIS.

ccontrol stop <ensemble> quietly

ccontrol start <ensemble>

where you should replace <ensemble> with your instance name.

if you work on windows, you can find ccontrol tool in bin directory of installed Ensemble.

you can find more details about using ccontrol in the documentation

Hi Alexi, 

It sounds like you are wanted to:

  • run the task in Caché Task Manager which does external call to some *.bat/.cmd file (so, calling out Caché)
  • this .bat file should run some code inside Caché (so, calling in Caché back again)

This scenario is possible (despite some security caveats), but (pardon me) - just rises unneeded difficulties. If your task can be solved easier than it initially seemed to be, why not take the easier (and more secure) way?