Renaming the Files and moving into another folder

Str_xNetworkPath : “C\User\Test\X”

I am using Invoke method for renaming the file(.xlsx) for that I am giving hard coded value as old_file name : str_xNetworkPath +“"+ Now.ToString(“yyyy”)+” “+“Bank of BAD”+”"+Now.ToString(“MM-yyyy”)+“"+“BAD_CORP_”+Now.ToString(“MM-dd-yy”)+” “+“v2”+”.xlsx" but due to “v2” value is changing many times so need to make it dynamic so that code will not give issue if the file name changes to “v1”

Also renaming 2nd another file old file name as : str_xNetworkPath +“"+ Now.ToString(“yyyy”)+”"+Now.ToString(“MM-yyyy”)+“"+“NONBAD_CORP_”+Now.ToString(“MM-dd-yy”)+” “+“v2”+”.xlsx"

from the same location str_xNetwork path if am putting in for each loop its throwing error when coming on 2 iteration ,

Any help would be appreciated here .
Thanks in advance !!

Why are you doing this in Invoke Code instead of just using the Rename File and For Each activities?

If i am doing the rename/Move file then also its giving issues on second file from the same location in for each loop

What is the issue? What’s the error?

This is sorted … when loop comes on 2 iteration then the file already moved to the desired folder so I put continue on error check , if the file is moved then it will continue to next iteartion and complete the run successfully…

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