Is there a way with which we can modify the date of folder in file explorer or is this a part of Ntfs architecture which can't be changed. Assuming there is no NTFS restriction; how can I change the creation time of a folder using c#
Asked
Active
Viewed 1,264 times
-1
-
Which date do you want to modify? how do you intend to do it? Programming? What language? This question needs more information – Matt Aug 23 '14 at 03:33
-
@Matt The created date of the folder in file explorer . I am not able to change it . If there is any way i would like that to achieve programmatically using c# – abc Aug 23 '14 at 04:09
-
What are you hoping to accomplish by changing the date? – Matt Aug 23 '14 at 04:12
-
1Here is the MSDN for what you are asking http://msdn.microsoft.com/en-us/library/system.io.directory.setcreationtime(v=vs.110).aspx – Matt Aug 23 '14 at 04:13
-
I guess this will work. – abc Aug 23 '14 at 04:21
1 Answers
0
Excerpt from the MSDN in the comments
string n = @"C:\test\dirToChange";
//Create two variables to use to set the time.
DateTime dtime1 = new DateTime(2002, 1, 3);
//Set the creation time to a variable DateTime value.
Directory.SetCreationTime(n, dtime1);

Matt
- 45,022
- 8
- 78
- 119