ACT NOW: The Alteryx team will be retiring support for Community account recovery and Community email-change requests Early 2026. Make sure to check your account preferences in my.alteryx.com to make sure you have filled out your security questions. Learn more here
Start Free Trial

Alteryx Designer Desktop Discussions

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

Run Command to Copy/Move/Rename a file

RCern
8 - Asteroid

Hi Everyone, 

I am having a hard time utilizing the Run Command tool to take a file on a network shared drive and copy and paste it to a new location on the network shared drive and rename it as well.  Below is what I have done but the Run Command hangs indefinitely.  The file I am trying to copy has 80K rows and is 1870kb in size, not sure if that is playing a part.  Can anyone look at my workflow and tell me what I am doing wrong?  Also, the source file I am copying has a dynamic name that will change each month and I am stripping the date from the file name when I rename it.

9 REPLIES 9
jrlindem
12 - Quasar

I would recommend switching to robocopy syntax for your cmd:  robocopy "C:\source" "D:\Destination" "file.xlsx" /MOV

 

I've had better luck with this when there are directory permissions that differ.

RCern
8 - Asteroid

@jrlindem   Would this be the correct syntax:  'robocopy' + [SourceFile] + '" "' + [TargetFile] + '"' + '/MOV'

 

Is my Run tool configured properly?  It seems to still hang

jrlindem
12 - Quasar

Make sure you put in spaces and separate out the file for robocopy.  More like:

 

'robocopy "' + [Source] + '" "' + [Target] + '" "' + [File] + '" /mov'

 

jrlindem_0-1764818155624.png

 

RCern
8 - Asteroid

@jrlindem  Thank you!  How do I configure the Run Command Tool because it seems to hang/cycle?  Is that due to file size and/or number of rows contained?

jrlindem
12 - Quasar

This is how I configure my Run Command.  I generally always name my command line field as "Command" but I don't think that's actually necessary.  Just make sure you have just one single distinct field feeding into the tool, it's formatted as something like v_string and the size of the field is 500+/- or less.  Also running silent is good for when it's production, so you don't get the cmd window popping up, but I like to see it when i'm building just so I know it's working.

 

If you have it configured correctly, it should run very quickly.

 

jrlindem_0-1764884585737.png

 

RCern
8 - Asteroid

@jrlindem THank yoU!

 

 

jrlindem
12 - Quasar

I wasn't able to get back quick enough to address that error...  did you get it figured out?  If so, what was it?  -Jay

RCern
8 - Asteroid

A backslash instead of a forward slash lol

jrlindem
12 - Quasar

@RCern  oh gosh, sorry about that.  In my haste... lol

But glad you got it sorted.  Have a good weekend,  -Jay

Labels
Top Solution Authors