Create folder name as Month Year (Jan 2024)

Hi All,

I want to create a folder name as Currentmonth and current year, can I use below

datetime.now.ToString(“MMM-yyyy”)

@marina.dutta

Yes, you can use DateTime.Now.ToString("MMM-yyyy") to get the current month and year in the format “MMM-yyyy”. This will give you the abbreviated name of the current month followed by the four-digit representation of the current year.

image

"C:\Users\rlgandu\Downloads\"+Datetime.now.ToString(“MMM-yyyy”)
1 Like

Hi @marina.dutta

or

Cheers!!

Hi @marina.dutta

→ Use Folder Exists and give the below condition and store the output in a variable say FolderExists

Path.Combine("C:\",Now.ToString("MMM yyyy"))

change the folder path accordingly within double quotes.
→ Use the below in If condition:

If
  FolderExists
Then 
   \\Do nothing
Else
     Create Folder activity and give the below syntax
        Path.Combine("C:\",Now.ToString("MMM yyyy"))
End If

Regards

1 Like

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