Alteryx Designer Desktop Discussions

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

Creating a copy of a file using batch script

ALT_2358
9 - Comet

Hi, 

 

I have a workflow that creates a copy of a file using a batch script. 

 

It works well when using mapped drive paths but returns an error when using UNC Paths:

 

  • X:\Batch Input Macro\Example\File 1.xlsx - Works
  • \\bredsntp009\corptax\Alteryx Server\Batch Input Macro\Example\File 1.xlsx - Error code 1

 

I've attached a copy of my workflow; this is what the command looks like: cd \\bredsntp009\corptax\Alteryx Server\Batch Input Macro\Example\ & copy "File 1.xlsx" "X:\Batch Input Macro\File 1- Temp.xlsx"

 

The blob tool method for copying files works for both path types but it gives an error if the Excel file is open, whereas the batch script method runs fine even if the files are open. For my process, I really need to be able to copy the files even if they are open. 

 

I need to use UNC Paths because I'll be uploading to Alteryx Server.

 

Any advice would be much appreciated.

2 REPLIES 2
ALT_2358
9 - Comet

Managed to find the fix and it couldn't have been simpler!

The 'cd' in the run command just needed to be changed to 'pushd', so it becomes: pushd \\bredsntp009\corptax\Alteryx Server\Batch Input Macro\Example\ & copy "File 1.xlsx" "X:\Batch Input Macro\File 1- Temp.xlsx"

atcodedog05
22 - Nova
22 - Nova

Glad to hear it's solved 🙂 @ALT_2358 


Cheers and have a nice day!

Labels