How can I check if the folder is inside c drive, if is not inside, create new folder.
Try using those activities
Use If Activity with if conditions
Place the Create folder activity and pass the same path.
If there is no solder in a preferred location, the bot will create the folder, else it won’t.
You can try with is expression in the
not System.IO.File.Exists("Your folder")
Try this expression directly in the if condition
If true → leave empty there
If False-> Create Folder
And that warning symbol is because you are using hardcorded path in the Field so you create a variable to store that path
thankyou, it works
hi, can i ask how to name my new folder the same month as one of the directory name in c drive. For example, from c drive, i have to check that the there is a folder named “2022 Folder”, i have to get the year, then from there i name the new folder as “2022 sheet”, if is “2023 Folder”, i name my new folder as “2023 sheet”.
Just use like this in the Create folder activity
"C:\Users\UserName\Documents\"+DateTime.Now.ToString("yyyy") DateTime.Now.ToString("yyyy")-> This will get the current year (2022) DateTime.Now.AddYears(-1).ToString("yyyy") -> this will get the previous Year (2021) DateTime.Now.AddYears(1).ToString("yyyy")-> this will get the Next Year (2023)
What about i need to get the year from the existing folder, but not from getting current year.
This is the Input folder
To get the Folder Name
It will get only the folder name
Check out this Tutorial for reference
hi, how can i check the folder name itself or must check through directory, if there is a “-” inside folder name, it shows error
What is the error and share the screenshot @C99
Variable type is should be Array(String)
okay, thank you
Great, Let us know if you face any issue @C99
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.