Question
Sylvain DUBOIS · Mar 9

How to get Script execution result in CMD caller

Hello

I am running a script from a CMD command line using : C:\CacheSys\Bin\cterm.exe /console=cn_iptcp:127.0.0.1[23] myscript.SCR %CD%

The script should authorize something (or not) in the following lines of the GO.CMD

 

But How can i return an information from inside the script to the GO.CMD script ?

Any idea ?

Product version: Ensemble 2017.1
0
0 173
Discussion (2)1
Log in or sign up to continue

Not 100% sure of the requirement but if you write the output from the Cache code as if it was to the terminal then you can redirect the output to a file by appending >output.file but I don't think cterm is the way to do that as cterm will trap all the output itself, you would need to use csession for that.

You could just write to a file in your Cache code or run an external command/script from inside the Cache code?

Well I did something similar : the caché script creates a "success.txt" file when ok and an "error.txt" file when nok.
So the CMD scripts checks the presence of each file to decide what to do next