· Jul 1, 2022

Is there a way to use IRIS from command line (eg: batch file), the same way as it can be done in CACHE ?

We recently migrated to IRIS. Before, the CACHE.EXE executable could be invoked from a batch file directly : 

C:\InterSystems\Cache\bin\cache.exe -s C:\InterSystems\Cache\mgr -U %SYS

This will display the following in console : 

Node: DESKTOP-8H4B321, Instance: CACHE


Additionally, the pipe instruction can be used to redirect some commands directly

echo write 50 | C:\InterSystems\Cache\bin\cache.exe -s C:\InterSystems\Cache\mgr -U %SYS

I am looking for the same thing in IRIS. If I do the same command line with IRIS executable, I got an error : 

Invalid argument to IRIS : -s

I have looked into documentation and the following can be used but it's not the equivalent :

IRIS.exe run IRIS
IRIS.exe console IRIS
IRIS.exe terminal IRIS

EDIT : I found a similar question here

Product version: IRIS 2022.1
Discussion (5)1
Log in or sign up to continue

Thanks. This is the same trick as what I found in "InterSystems IRIS Adoption Guide".

If I wrote this in command line (eg: iris session IRIS), it outputs the command line documentation (which indicate something went wrong). "iris console IRIS" works by the way. Do I need to enable something before I can use session parameter ?

EDIT : it seems that irissession.exe is the equivalent on Windows.

I forgot to mention I am on Windows.

"iris terminal" works somehow. There is several issues with this approach :

- it does not redirect input/output (eg: echo 50 | iris terminal IRIS). One workaround is to put commands into a routine and call it explicitly : iris terminal IRIS MYROUTINE %SYS

- it does not block/wait until completion (which is an issue since I use that command from a deployment tool that need to know once it's done)

- there is no way to provide custom credentials (eg: execute commands with a specific user)