i have to write vb script to get current month name, week number, week starting date and ending date for eg: Feb_3rdWeek_11th_to_17th in this format.
this VB script file i have to call in RPA tool.
DateTime dt=DateTime.Now;
Output_Format=dt.ToString("MMMM");
temp=dt.DayOfWeek-DayOfWeek.Monday;
startdate=dt.AddDays(-(int)temp);
enddate=dt.AddDays((int)(7-temp));
CultureInfo ci = CultureInfo.CurrentCulture;
int weekNumber = ci.Calendar.GetWeekOfYear(dt, CalendarWeekRule.FirstFourDayWeek, DayOfWeek.Monday);
weeknumber= weekNumber;
The above code is written in c#, it serves your purpose. except it returns the week number of the year instead of the month. with the values at your hand you can format it the way you wanted.