Get file on network drive

Hello guys,

i have an automation that read and write in csv file,
it works fine for quite sometime, but when i change the machine host,
the automation is now failing, it has something to do with network drive having different name.

what can i do to make my RPA look only for the name not the letters of the drives like (A:) (Z:) (C:) or (D:),
i want it to search for “IT Dept” , “Account Dept” or “Marine Dept”

thank you for your help!

Hi @JomarieBancolo

To make the location more dynamic, you can use the Get Environment Variable activity. This activity will automatically detect a specific base location on the host machine and dynamically reference it instead of you have to hard code it.

It will ignore the base path including the letter of the drive {(A:), (Z:)} etc. For example, if your CSV is in “My documents” it will automatically reference "C:/Users/{user}/MyDocuments/

Provide the output variable and then use that variable in your code, with your final location. For example str_HostBaseLocation + “IT Dept”.

Let me know if this helps :slight_smile:

Hi @JomarieBancolo

Please avoid using the paths with network drive names.

Instead use the full absolute paths always to avoid any issues.

For eg. If letter Z corresponds to cv.ca\files\, then use the full path like below…

cv.ca/files/Host

Instead of Z:/host

Hope this helps.

Hi @JomarieBancolo

You should strive to use UNC paths in stead of drive letters.
If you don’t know the UNC path of the drives, you can open a Command Prompt and write:

net use

This will list attached drives and display the underlying UNC path.

Eg.

Drive:
P:\

could be

UNC path:
\\server\drive\etc

Regards
Soren