Using loadti with Node-red

I'm trying to execute a command that works in the command prompt.
I've verified and the string works in the command prompt.

But when I use the EXEC node, it doesn't seem to work

[
    {
        "id": "f5e0962424954702",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "2f226dc2afcea3e9",
        "type": "exec",
        "z": "f5e0962424954702",
        "command": "set PATH=%PATH%;C:\\ti\\ccs1280\\ccs\\ccs_base\\scripting\\examples\\loadti",
        "addpay": "",
        "append": "",
        "useSpawn": "false",
        "timer": "10",
        "winHide": false,
        "oldrc": false,
        "name": "",
        "x": 540,
        "y": 240,
        "wires": [
            [
                "c050ff703eaf5227"
            ],
            [
                "b9d3789072ad1f01"
            ],
            [
                "dc8181e4e34ed768"
            ]
        ]
    },
    {
        "id": "c050ff703eaf5227",
        "type": "debug",
        "z": "f5e0962424954702",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 970,
        "y": 180,
        "wires": []
    },
    {
        "id": "b9d3789072ad1f01",
        "type": "debug",
        "z": "f5e0962424954702",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 970,
        "y": 220,
        "wires": []
    },
    {
        "id": "dc8181e4e34ed768",
        "type": "debug",
        "z": "f5e0962424954702",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 970,
        "y": 260,
        "wires": []
    },
    {
        "id": "1c091fe5c3934d25",
        "type": "inject",
        "z": "f5e0962424954702",
        "name": "SET PATH",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 240,
        "wires": [
            [
                "2f226dc2afcea3e9"
            ]
        ]
    },
    {
        "id": "f4ca68a198b8dc20",
        "type": "exec",
        "z": "f5e0962424954702",
        "command": "loadti",
        "addpay": "",
        "append": "",
        "useSpawn": "false",
        "timer": "10",
        "winHide": false,
        "oldrc": false,
        "name": "",
        "x": 370,
        "y": 420,
        "wires": [
            [
                "c0856c66ca88de7a"
            ],
            [
                "b13935526a1071b0"
            ],
            [
                "4adf7302dd6baa9b"
            ]
        ]
    },
    {
        "id": "c0856c66ca88de7a",
        "type": "debug",
        "z": "f5e0962424954702",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 570,
        "y": 360,
        "wires": []
    },
    {
        "id": "b13935526a1071b0",
        "type": "debug",
        "z": "f5e0962424954702",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 570,
        "y": 420,
        "wires": []
    },
    {
        "id": "4adf7302dd6baa9b",
        "type": "debug",
        "z": "f5e0962424954702",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 570,
        "y": 480,
        "wires": []
    },
    {
        "id": "1b69fe592e6a3f44",
        "type": "inject",
        "z": "f5e0962424954702",
        "name": "LOADTI",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 220,
        "y": 420,
        "wires": [
            [
                "f4ca68a198b8dc20"
            ]
        ]
    },
    {
        "id": "add8b559e7912a9f",
        "type": "comment",
        "z": "f5e0962424954702",
        "name": "",
        "info": "",
        "x": 300,
        "y": 500,
        "wires": []
    },
    {
        "id": "085fcc5d2a43e8d4",
        "type": "exec",
        "z": "f5e0962424954702",
        "command": "loadti -c c:\\ztemp\\TMS320F28377D.ccxml c:\\ztemp\\FLASH1.out",
        "addpay": "",
        "append": "",
        "useSpawn": "false",
        "timer": "10",
        "winHide": false,
        "oldrc": false,
        "name": "",
        "x": 970,
        "y": 640,
        "wires": [
            [
                "3a512dd2734364c9"
            ],
            [
                "a662fa1fc1c7fb8d"
            ],
            [
                "f9d1207b6da54370"
            ]
        ]
    },
    {
        "id": "3a512dd2734364c9",
        "type": "debug",
        "z": "f5e0962424954702",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1430,
        "y": 580,
        "wires": []
    },
    {
        "id": "a662fa1fc1c7fb8d",
        "type": "debug",
        "z": "f5e0962424954702",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1430,
        "y": 640,
        "wires": []
    },
    {
        "id": "f9d1207b6da54370",
        "type": "debug",
        "z": "f5e0962424954702",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1430,
        "y": 700,
        "wires": []
    },
    {
        "id": "0a97cbeb31aa6dd8",
        "type": "link in",
        "z": "f5e0962424954702",
        "name": "link in 3",
        "links": [],
        "x": 115,
        "y": 660,
        "wires": [
            [
                "48089d36c5298a0b"
            ]
        ]
    },
    {
        "id": "532e7da4cc4fa936",
        "type": "rising-edge",
        "z": "f5e0962424954702",
        "name": "",
        "threshold": "0.5",
        "x": 590,
        "y": 660,
        "wires": [
            [
                "085fcc5d2a43e8d4"
            ]
        ]
    },
    {
        "id": "8dd91eb83d1469f8",
        "type": "change",
        "z": "f5e0962424954702",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 400,
        "y": 640,
        "wires": [
            [
                "532e7da4cc4fa936"
            ]
        ]
    },
    {
        "id": "48089d36c5298a0b",
        "type": "switch",
        "z": "f5e0962424954702",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "true"
            },
            {
                "t": "false"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 210,
        "y": 660,
        "wires": [
            [
                "8dd91eb83d1469f8"
            ],
            [
                "42e0875cdcbe6ebf"
            ]
        ]
    },
    {
        "id": "42e0875cdcbe6ebf",
        "type": "change",
        "z": "f5e0962424954702",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 400,
        "y": 680,
        "wires": [
            [
                "532e7da4cc4fa936"
            ]
        ]
    },
    {
        "id": "9b16580f7953a0c6",
        "type": "ui_button",
        "z": "f5e0962424954702",
        "name": "",
        "group": "88145eb0.23895",
        "order": 7,
        "width": 0,
        "height": 0,
        "passthru": false,
        "label": "GREEN",
        "tooltip": "",
        "color": "",
        "bgcolor": "",
        "className": "",
        "icon": "",
        "payload": "",
        "payloadType": "date",
        "topic": "topic",
        "topicType": "msg",
        "x": 600,
        "y": 620,
        "wires": [
            [
                "085fcc5d2a43e8d4"
            ]
        ]
    },
    {
        "id": "a4f4c9be21d50a87",
        "type": "comment",
        "z": "f5e0962424954702",
        "name": "TURN ON C7 FROM PLC",
        "info": "",
        "x": 190,
        "y": 620,
        "wires": []
    },
    {
        "id": "9ef820f5f01a3a67",
        "type": "inject",
        "z": "f5e0962424954702",
        "name": "FULL STRING",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 600,
        "y": 760,
        "wires": [
            [
                "085fcc5d2a43e8d4"
            ]
        ]
    },
    {
        "id": "88145eb0.23895",
        "type": "ui_group",
        "name": "PLC_Read",
        "tab": "",
        "order": 1,
        "disp": true,
        "width": "8",
        "collapse": false,
        "className": ""
    },
    {
        "id": "e9a1c325659ca516",
        "type": "global-config",
        "env": [],
        "modules": {
            "node-red-contrib-edge-trigger": "1.0.1",
            "node-red-dashboard": "3.6.6"
        }
    }
]

Setting the path seems to work. I do get a code 0 returned.
But when I inject the loadti, it throws up an error saying command not recognized. Setting the path was supposed to take care of this. I know I'm missing the config file and the output file, but I was expecting something like this

Thoughts on this?

If exec1 changes PATH, have you tested that it remains changed in exec2?

I don't know Windows but it definitely would not persist in a Linux shell.

Thanks for the help. It turns out the set path does not persist! So I had to write a batch file to execute the set path and loadti. Then I have the exec execute the batch file. That worked. Thanks again.

As a general advice for Windows, prefer using powershell rather than batch files which are extremely limited have many quirks. They are still alive just for the sake of tradition.

And the fact that the learning curve for PS is so steep - then add on that MS keep changing adding/removing commands between versions and extending other commands and keeping on top of it as well as trying to use the internet to get help is always fraught (i have been working in it for about 7 years now and still hate it) (and i come from windows) but still prefer Bash scripting

Craig

Powershell syntax is weird and too literal. Better run NR in docker using a linux image