Creating a copy of a file using batch script
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
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"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Glad to hear it's solved 🙂 @ALT_2358
Cheers and have a nice day!
