Hi everyone,
I want to use the run command tool and batch files to copy a file from my Engine.WorkflowDirectory to a folder inside the same directory, except the folder name updates with the date.
This is what I have written for my batch file (although I really don't know how to write the second part):
@Echo OFF
copy /y "%Engine.WorkflowDirectory%OB_zip.zip" "%Engine.WorkflowDirectory%[FolderName]"
Pause
The folder name is some variation of Output_YYYY-MM-DD.
I've attached an image of the part of the workflow I'm stuck on for reference:
Solved! Go to Solution.
Your syntax looks correct but i'm not sure copy can create new directories (presuming thats what you need)
Try xcopy instead which can.
Also, when experimenting with batch files, try running each part of your script in command prompt first to test as you will get proper errors rather that error code 1 from Alteryx
Thanks for the reply!
No, I used another bat file and run command tool to create a directory with the file name [Folder Name]. I don't know if using [Folder Name] will translate over to batch files though?
Hi @helenjin1
You need to change your formula for the copy command to
'copy /y "' + [Engine.WorkflowDirectory] + 'OB_ZIP.Zip" ' + '"'+ [Engine.WorkflowDirectory] + [foldername]+ '"'
The %Engine.XXX% variables will only be expanded when you're running a command directly within Alteryx. In a batch file, your need to specify the full path
Assuming you had "temp" in the [foldername] field, the formula from above will create
copy /y "C:\Program Files\Alteryx\bin\OB_ZIP.Zip" "C:\Program Files\Alteryx\bin\temp"
which will run properly in a batch file
Dan
Thank you for the reply!
Sorry it doesn't seem to be working for me. Could you post an example workflow?
I figured it out. My Output was not in any specified format. I changed it to csv. and everything worked out smoothly!
User | Count |
---|---|
19 | |
15 | |
15 | |
9 | |
8 |