How to rename a file without moving the file

Hi i have an excel where I need to rename with date stamp and the rename should happen in same destination

Any idea on this?

Hi @Ajay_S1 welcome to community

Use Invoke code activity

Create 2 code arguments ,
Provide this value

FullLocation- Your Full Excel File path
Filepath- Your folder Path

and enter the below code

FileSystem.Rename(FullLocation,FilePath+“Your File Name” & Now.ToString("MMddyyyy”) & “.xlsx”)

Hope this helps.

1 Like

Thanks for reply,
Can you attach the code for my reference

sure
rename.zip (1.3 KB)

Hi @Ajay_S1

You can also try with Rename file activity

Regards
Gokul

2 Likes

Thanks @nikhil.girish for sharing the code

Thank you Gokul for one more method

1 Like

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