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.
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
But if I try and change directory across drives, the command doesn't work
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
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:
User | Count |
---|---|
106 | |
82 | |
70 | |
54 | |
40 |