Move File activity not working for files in mapped network drive

Hello,

I am currently automating a process that involves moving files from a folder in a Sharepoint mapped network drive (drive Z:) to another folder in the same drive. However when I try to use the “Move File” activity, I get the following error:

image
Is there a different activity I have to use to move files in a mapped network drive?

@Hisuhong

No. It should work.

Could you please show me screenshot of how you passing file path here ?

image
image
image
image

@lakshman

Hello @Hisuhong,

In using the move/copy/etc activities it is best to use the full path and not the mapped network path.

From what i can see from your screenshots, you are missing the filename in the destination. Also the path cannot end without the ""

Example:

Source “Z:\Test\New_Forms\Sample.xlsm” to Destination “Z:\Test_Complete\Sucess\Sample.xlsm”

Give it a go like this

@lfcosta Even with the file name in the destination, I get the same error :frowning:
I also have to use the mapped network drive because this is linked to my sharepoint folder, which is what I have to automate

Hi @Hisuhong!

You are missing extension of the file in the Thing2 variable, please add “.xlsm” extension same as Thing vaiable and try again.

Cheers!

@Hisuhong , does the file already exists in the destination folder? Can you try without the overwrite?

A way to bypass the need for the overwrite would be to use the activity path exists, where if the filename is already present you use the delete activity to delete the file before moving.

I’ve tried on my machine with a local folder w/ sucess

I’ve tried also moving the file from a network drive (mapped) w/ sucess
image

@lfcosta Ah in the mapped network drive case, I am moving a file in a folder in my mapped network drive, drive Z, to another folder in drive Z. I believe you moved it from a mapped network drive to your local drive. I have to keep everything in drive Z

@Nikola_Drazic unfortunately I am still getting the same error :frowning:

Hmmm, let’s try with powershell.
Please use invoke powershell activity and type this: “Copy-Item “C:\Wabash\Logfiles\mar1604.log.txt” -Destination “C:\Presentation”” please check isSript in properties and give it a go.

First path is file path and destination is folder path.

Hello @Nikola_Drazic

I tried "Move-Item " + Thing + " -Destination " + Thing2 because I wanted to move the item instead of copying. This time I changed the value of the variable Thing to “Z:\Customer\New_Forms\Cust3_CAD_Customer Form.xlsm”. However when running the powershell, it gave me this error
image

Note: I also tried Copy-Item and it gave me the above error as well

I found that when moving a file you need to use the full path of the directory not the mapped path.

Try using the Root Directory of the current drive when attempting to move.

EX… \\"Org Server"\...\...\...\...\Test\New_Forms\Sample.xlsm\


Let the \...\...\...\ be the parents of the \Test\New_Forms\ Directory

1 Like

Hi @Hisuhong!
You just need to type command like this: “Move-Item -Path '”+Thing+“’ -Destination '”+Thing2+“'”

Please try sample that I made.

Cheers!

Main.xaml (5.0 KB)

@Jarzzz unfortunately even with the same path, I keep getting the same error…

@Nikola_Drazic It still throws the same error as the move file activity. I will send you my workflow below:
TEST.xaml (6.1 KB)

Hi @Hisuhong,
it’s working on my machine. I made same folder structure and folder/file names are the same, only drive letter is different.
Did you tried this sample locally on your machine as well?

TEST.xaml (6.1 KB)

Hello @Hisuhong,

Using the move activity i can move the file from the networkpath to the desktop or other networkpath w/o issue.

Please find the attached workflow and see if it works for you w/ your filepath.
Sequence.xaml (4.4 KB)

I totally agree with @lfcosta…I never had any problems with copy/move activities.

@Nikola_Drazic @lfcosta for both, I keep getting the same error “The filename, directory name, or volume label syntax is incorrect.” with both the Move File activity and powershell…Which is strange because it works for the both of you… :sob: I even tried it with the full path but that still gives me an error

@Hisuhong, you got the same error w/ the workflow i uploaded? If you are trying the workflow i shared can you share a print of the configuration and error?

hmmm… Make sure you have the proper path.Can you ping the directory via \\"Org Server"\"Parent Folder\Parent Folder\Test\New_Forms\Sample.xlsm\ outside of UiPath?

1 Like

@lfcosta
From Path:
image
Destination Path:
image
Error:
image

@Jarzzz what do you mean by ping the directory outside of UiPath?