Colons are not accepting while using Timestamp

Hello folks,

I am trying to create a directory with current date and time stamp and it looks like “Path of the directory” & DateTime.Now.ToString(“MMMM dd, yyyy_HH_mm_ss").In between HH mm and ss if i provide space or _ or ; it was creating directory successfully but if I used colon it was throwing an error “The given paths format is not supported”. Could anyone suggest on the same

@ushu,

It’s not the UIpath issue. Generally we can’t use below characters at the time of creating folder names. That’s why you are getting above error.

Manually you try once whether it is allowing or not check once

Characters: / \ : " < > ?

Thanks for your response. will check on the same. I have another query that I want to create a excel file with Timestamp along with the file name. For this I simply taken excel scope in that I provide “path”& DateTime.Now.Tostring(“HH:mm:ss tt”) & “Logfile.xls”. If I run this it was showing the exception as given path is not supported.Please suggest on the same

1 Like

@ushu,

As I already said, we can’t use some characters in file name or folder name. In above you are trying to use colon in the file name. Because of that it is throwing error. Replace colon with underscore or any other characters except those mentioned characters above.

Thanks for your prompt response. Will try on it

1 Like