This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
It's the most wonderful time of the year - Santalytics 2020 is here! This year, Santa's workshop needs the help of the Alteryx Community to help get back on track, so head over to the Group Hub for all the info to get started!
I have a number of files in a directory, some of which I'll process, some of which I won't, but all YXDBs. Once all of the files I want to process have been processed then I want to move them to a different directory (or maybe delete, still TBC). I can do this using the command prompt.
The difficulty I'm having is how to run the command prompt, how to configure the Run Command tool. Apparently it needs either a Write Source or Read Results, I can't think what these could be to run a command in the command prompt.
I'll actually be generating the list of files to move into a list and am comfortable using a macro to alter the Command Arguments to dynamically load the command line details. What I don't know how to do is to get actually get the Run Command configured.
Frustratingly I'm unable to upload my 19kb screen shot of the current Run Command configuration so to describe I have entered "cmd" in the Command section and the correct arguement in the Command Arguments [Optional] section, which gives the error "Either an Output connection or Input Connection is required"
Thanks for the response Michael. Not there yet and I'm confused why. I created a Dummy.csv as my Input (Write according to the Run Command tool) and that allowed it to work - ot at least the cmd prompt opened. The Command Arguments weren't moved into the command prompt. It actually does nothing apart from open the command prompt and then spinds in the Run Command icon on the workflow until I manually cancel. The command prompt remains open but doing nothing during this time.
I restested and the 'argument' entered should work, at least it does when I enter into the command prompt opened by Alteryx when trying to Run Command. Is this anything you come across before?
That does work, many thanks for that. I would really appreciate it if you could explain what is actually happening at each step. I understand the formula field created the Move statement and where to move the file. I don't understand what happens in the Command string after the ">" sign where it ends with MoveCommand.txt.
In addition what is the 'Write Source' %/temp%\MoveFiles.bat? I can't see if/where that was created in the script?
I've got it now, thanks for the explanation. The Run Command tool is creating the batch file in the "Write Source [Optional]" area, with the bat file being the script written in the formula tool and being passed into the Run Command tool.
The Run Command tool then executes the batch file it has just created. This batch file creates the MoveCommand.txt file which is then referenced in the Run Command "Read Results [Optional]" area.