How to copy excel file from local to shared folder with time stamp as filename?

I have excel in my local need to share that excel to shared network path for eg path is like this (\htrewg\sample\test)
need to copy excel with name( test_19-07-23_14:13pm.xlsx)

Please help anyone

Assign - NewFileName: “test_” + Now.ToString(“yy-MM-dd_HHmm”) + “.xlsx”

Copy the Excel file to the shared network path, you can use the “Copy File” activity. Provide the source file path (local path with the new file name) and the destination file path (shared network path) in the “Copy File” activity.

Make sure to use double backslashes for the shared network path in UiPath, like this: "\htrewg\sample\test".



sourceFilePath = “C:\Path\To\Your\File.xlsx”

destinationFileName = “test_” + Now.ToString(“dd-MM-yy_HHmm”) + “.xlsx”

destinationFolderPath = “\htrewg\sample\test”

destinationFilePath = Path.Combine(destinationFolderPath, destinationFileName)

Copy File:
Source = sourceFilePath
Destination = destinationFilePath

path not supported error coming.
Path for eg is (“\htrewg\sample\test”)

path not supported error coming
path for eg is like this(“\htrewg\sample\test”)

Try double slash \ htrewg\sample\test\


destinationFolderPath = “\\htrewg\sample\test”

Copy File:
Source = sourceFilePath
Destination = destinationFolderPath + “\” + destinationFileName

path not supported error coming again

with double slash also path not supported error coming


“\htrewg\sample\test”+ Now.ToString(“yy-MM-dd_HHmm”) + “.xlsx”

Try this

from local folder(“c:\test.xlsx”) to network shared path (“\htrewg\sample\test.xlsx”)
Is this possible with copy file or move file activities?

Hi @vnsatyasunil

currentDate = DateTime.Now.ToString(“dd-MM-yy_HH:mm tt”)
destinationPath = “\htrewg\sample\test\test_” + currentDate + “.xlsx”

Copyfile(“C:\path\to\your\file.xlsx”, destinationPath)

Hope it helps!!

it is working but I need file name like this test_19-07-2023_15:50:02.xlsx


“\htrewg\sample\test_”+ Now.ToString(“dd-MM-yyyy_HH:mm:tt”) + “.xlsx”

Try this

destinationPath = "\htrewg\sample\test"+“test_”+ currentDate + “.xlsx”

tried path not supported error

Datetime variable
“test_”+ Date_Var.ToString+“.xlsx”

path not supported for this also


Include(Double slash)before the “htrewg” only

@vnsatyasunil Is this shared network path being accessed by multiple users?