Hi everyone,
I have a question that I'cant really figure out; how to use the Command Tool properly. All I'm trying to do is create a Folder with today's date with Alteryx, and I can do that through the Command Prompt.
for /f "tokens=2-4 delims=/ " %i in ('date /t') do MD "H:\%k%i%j"
However, when doing this through Alteryx, it is not working.
I don't really need an input or anything, but some people suggested that I convert the code /f "tokens=2-4 delims=/ " %i in ('date /t') do MD "H:\%k%i%j" to a BAT file and
read it as a result, but that is not working either. When I run the workflow, it just stops midway at 50% and it doesn't finish unless I close the CMD manually.
So right now I'm stuck and don't really know what is the best approach..writing the script as a separate file, as a formula input or in the Command Arguments section which I thought would work.
Any help is greatly appreciated.
Thanks!!
Solved! Go to Solution.
The run command tool is super annoying.... and awesome at the same time.
I have both setups - push in command or just have it run a bat file.
The push in is nice if you think you need to modify down the road or want to use the workflow down the road for something else.
Here is an example of 'making' the bat file and pushing into run command tool.
Basically you build out what would be in the bat file and then setup run command to look like this.
Otherwise just use a dummy input like this and point to bat file.
You have nearly got it set up correctly.
cmd.exe needs a /c argument to run the command.
Change the arguments to:
/c "for /f "tokens=2-4 delims=/ " %i in ('date /t') do MD "H:\%k%i%j""
and it should work
You will need to read in a dummy file as you were but the run command should create the folder for you.
Thank you! That's exactly what I was looking for. So I can essentially create/move files around with the code inserted in the commands argument section?
yes as long as the command is surrounded by quotes should work fine
I spent so much time trying to troubleshoot and all I was missing was a "/c"!
Thank you so much for saving my 2 days of misery.
Winston