Rename folders

Hello !

Happy new year to evrybody ^^

I need your help to rename folders in Uipath
My flders are type as donald Mickey P1 / Donald Daosy P2 / Donald Pluto P3

And i want to rename it to delete P1, P2 and P3 in the name folder
to do => Donald Mickey / Donald Daisy / Donald Pluto
Do you think that is possible?

I think about replace P1 and P2 and P3 by β€œβ€

Thanks you !

1 Like

Hi, you can do somehting like this
image

  1. oldfoldername = original folder name e.g, D:\donald Mickey P1
  2. newFoldername = oldFolderName.Replace(β€œP1”,β€œβ€)
  3. use invoke method
  • TargetType = System.IO.Directory
  • MethodName = Move
  • parameters = oldFolderName and newFolderName variables

Hello @manu_debonne,

Yes, you can try this strVar.Replace(β€œP1β€œ,β€œβ€).Replace(β€œP2”,β€œβ€).Replace(β€œP3”,β€œ")

Cheers
@manu_debonne

Hi @manu_debonne,

Kindly refer below article it might helps you for Rename the folder

Thanks,
Neelima.

Thanks you ! I have used the move methode with thes replace arguments.

It’s work. thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.