How to map network drive

Hi everyone, I struck in an scenario can anyone help me.

I want to map a network drive using UiPath I don’t have any idea how to do it can anyone help how to connect to my network drive share folder.
Manual steps below.

image

Hello @ranaprathap928 ,

On the bottom of your screen is a hint:

image

You may want to type in the full path to your drive instead of using a Drive letter (that can change on different machines)

Example:

\\IN-HYD-COMPTD1\Your\Path\To\Your\Drive\Folder

Usually, your IT department will be aware of what you have access to and should be able to give you the full path

Hi @ranaprathap928,

You can map network drives by using either the Start Process activity or Invoke PowerShell activity and use the standard net use command line command

You can also use net use command in cmd or PowerShell to map network drives folders programatically.

Net use | Microsoft Docs

Net use can help shorten the URL path by mapping to the Nth parent folder of the file but still the FullPath to your file will be read as a Network Drive.

You can Map and Unmap drives programatically.

Also ensure that you have post checks to ensure the map drive is available by using the path exists activity within UiPath before performing further operations.

1 Like

Hi @jeevith i don’t know which code i have to use if you have any script to connect network drive please share with me.

Hello @AndyMenon i don’t know how to connect with uipath, if you have sample script please do share with me.

Sorry, but if you know the full path to the drive, opening a file is pretty much the same as opening a file on your local drive using UiPath File Activities.

Example:

\\IN-HYD-COMPTD1\Your\Path\To\Your\Drive\Folder\myfile.txt

@AndyMenon I want to automate it through UiPath. And that drive is password protected.

Step 1: Write a bat script like this:
==> net use \192.168.1.1\Foldername /user:yourdomain\yourAccount yourPassword
==> Name it “Connect.bat”
Step 2: Use activities “Start Process”, then pass the file name “Connect.bat” on it.

Hi @Nam_Pham I will check this

1 Like
  1. Assign UserName, Password, DriveLetter, and DrivePath to separate variables.
  2. Password must come within a single quote while assigning. eg - ‘Welsome$123’ since PowerShell will restrict the ‘$’ symbol.
  3. Invoke a power shell activity and include “net use “+ DriveLetter +”: “+ DrivePath +” /user:itape"+ UserName +” "+ Password in CommandText property.
  4. IsScript property must be checked.
  5. TypeArgument property must be a string.