Get Inspire insights from former attendees in our AMA discussion thread on Inspire Buzz. ACEs and other community members are on call all week to answer!

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Run Command Tool Error

cesarsantti
6 - Meteoroid

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"

 

cmd.PNG

cmd2.PNG

 

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.cmd4.PNGcmd3.PNG

 

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!!

 

5 REPLIES 5
anthony
11 - Bolide

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.

Capture.PNG

Basically you build out what would be in the bat file and then setup run command to look like this.

Capture.PNG

 

Capture.PNG

 

Otherwise just use a dummy input like this and point to bat file.

 

Capture.PNG

 

Capture.PNG

jdunkerley79
ACE Emeritus
ACE Emeritus

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.

cesarsantti
6 - Meteoroid

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?

jdunkerley79
ACE Emeritus
ACE Emeritus

yes as long as the command is surrounded by quotes should work fine

wkyu
5 - Atom

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

Labels