Alteryx Designer Discussions

Find answers, ask questions, and share expertise about Alteryx Designer.

General Discussions has some can't miss conversations going on right now! From conversations about automation to sharing your favorite Alteryx memes, there's something for everyone. Make it part of your community routine!

Copy Files from One Folder to Another - Workflow on Server

5 - Atom

Does anyone have a workflow solution for copying the contents of one folder into another folder with a Run Command or Event on the Alteryx Server? 

12 - Quasar

This post by @DanM helped me figure out to use the Run command in my applications:


I use the DEL command to delete files after I am done processing them as in @DanM's solution. I think you could use the same logic to do a MOVE command.


This link might help with the syntax:







5 - Atom

@ddiesel Thank you for the reply! That post is definitely helpful in understanding some functions for Batch Files, but in this case doesn't quite give me the insights to copying that I am looking for. 

12 - Quasar

You're welcome @stockcc1. I'm a relatively new user so others may be able to chime in.


Can you post more details about your use case?

9 - Comet

To run batch scripts (such as the copy command), I use a set of macros that look like this:



Using a Control Parameter allows me to swap out arguments to my batch script (such as OldFilePath and NewFilePath in this example).


Then the batch script is as simple as this:

@Echo OFF
Setlocal EnableDelayedExpansion
SET OldFile=%1
SET NewFile=%2

copy !OldFile! !NewFile!


A few notes:

  • The "Setlocal EnableDelayedExpansion" is necessary (if I remember correctly) to handle file paths with spaces.  
  • The dummy output is necessary to properly block downstream data streams if you are using this with a Block Until Done tool (see here for an exhaustive exploration of this issue)
  • You would need to modify this script to copy a whole directory, but the basic mechanism to achieve this is the same.  You just want to tweak the script above using different commands as outlined here
  • If you are copying network paths (which I am assuming you are if you are deploying to server), make sure that all of your paths are UNC based.  We've run into issues with using drive letters when going between local machines and executing on server.  

Hope this helps.


19 - Altair
19 - Altair



The batch (.bat) file would look like this:


MOVE /Y  \\NetworkDriveName\DirectoryPath\*.xls* \\NetworkDriveName\DirectoryPath\Archive


That "movefiles.bat" would be run as an event after run without errors and it would move all of the .xls* files.  


This being said, there is some level of risk when users start using command line actions on your server.


To move one or more files:
MOVE [/Y | /-Y] [drive:][path]file name1[,...] destination


[drive:][path]file name1 Specifies the location and name of the file or files you want to move.
destination Specifies the new location of the file. Destination can consist of a drive letter and colon, a directory name, or a combination. If you are moving only one file, you can also include a file name if you want to rename the file when you move it.
[drive:][path]dirname1 Specifies the directory you want to rename.
dirname2 Specifies the new name of the directory.
/Y Suppresses prompting to confirm you want to overwrite an existing destination file.


Alteryx ACE & Top Community Contributor

Chaos reigns within. Repent, reflect and reboot. Order shall return.