Bring your best ideas to the AI Use Case Contest! Enter to win 40 hours of expert engineering support and bring your vision to life using the powerful combination of Alteryx + AI. Learn more now, or go straight to the submission form.
Start Free Trial

Alteryx Designer Desktop Discussions

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

move files from one folder to other folder in network drive.

sparkle
7 - Meteor

HI Team,
I am exploring moving files (cut paste) functionality in Alteryx using Run command tool. and I successfully  moved files one folder to another folder. But when i am trying to achieve this on network drive, files are getting deleted from source folder but not moving to destination folder.
Can someone help how can we achieve moving files on network drive.

 

I have used same below workflow as reference just changed file paths.

11 REPLIES 11
OllieClarke
16 - Nebula
16 - Nebula

Hey @sparkle,
As @KGT says that is probably the issue at hand here. Instead of writing your .bat script to the drive, I'd recommend adding a command to the beginning of your script which changes the directory the command is running from to the directory your files are.

You can do this with the 'cd' command (https://www.tutorialspoint.com/batch_script/batch_script_cd.htm) although if you're changing drive, you may need to specify that drive first.

For instance, if I were in the temp drive on my C drive, and I wanted to change directory to "X:\SomeDirectory\TheDirectoryIWant"
I would write:

X:
cd "X:\SomeDirectory\TheDirectoryIWant"

 To demonstrate this, here's me going from my temp directory to a folder on my Z drive
image.png

But if I try and change directory across drives, the command doesn't work

image.png


As you're using UNC filepaths to your network drive, rather than mapped drives, you can use pushd (https://unix.stackexchange.com/questions/77077/how-do-i-use-pushd-and-popd-commands) to temporarily map that network drive and then go to its location. You can use popd to unmap at the end of your script

pushd "\\pu-cdot02-corp01\home\mamtal\microtesting\IP"
MOVE "FileA" "LocationA"
...
popd



Hope that helps,

 

Ollie

jrlindem
11 - Bolide

Reading through this thread.  Lots of great responses.  One thing to note about using the MOVE command, is that it does not inherently COPY/PASTE.  So the file itself can and will inherit any permissions from the source folder and adopt those into the destination folder.

Meaning if USER does not have permission to DIRECTORY_A but does have permission to DIRECTORY_B; then using MOVE to relocate a file from DIRECTORY_A to DIRECTORY_B could still prohibit USER from accessing the file, even if they have permission to DIRECTORY_B.

Better to use COPY or ROBOCOPY.  If you need to after that, you can always circle back and remove the source file after the copy has been performed and verified.

Think of this in steps:

  1. Copy the file and paste it into the new location
  2. IF EXISTS in new location THEN delete the source version of the file
Labels
Top Solution Authors