I'm pretty used to using the Workflow Configuration -> Events tab to fire a .bat file to run at the end of a module.
But what if I want to run the same bat file halfway through the module? I tried the Run Command, and pointed it towards my bat file, but the tool errors because it complains about needing inputs and outputs. I got confused and gave up. A lot of stuff in Alteryx is obvious, intuitive and clear. The Run command, alas, is not.
So how do I fire up a bat file within a module in the same way that you would if you put it in the Events tab?
My bat file is super simple, and just calls a vbs file, which in turn calls an Excel macro.
Here is the bat file:
And here is the vbs file called above. I realise it's a bit roundabout going from bat file -> vbs -> Excel macro, but it works, and for me that's all that matters.
On Error Resume Next
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Open("C:\Temp\Workbook.xlsm", 0, True)
Set xlBook = Nothing
Set xlApp = Nothing
So my question is really why can't I just plug my bat file into the Run Command in the same way that I can run it from the Events tab?
@JohnTdata I feel your pain. Wherever you want to insert your run command, I would connect that path to the run command tool, and then setup your run command tool to just output to %TEMP%dummyfile.yxdb. then you can input your bat file in the command section of the run command tool. Then I would setup your read results section of the run command tool to read that same dummy file.
You can use a Text Input or formula tool to construct the batch script (line by line), then that will go into your output which will write it as a .bat which the cmd tool can then read. I've attached an example.
Regards, Stephen Ruhl Principal Customer Support Engineer