|
-
Oct 8th, 2006, 11:14 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] [2003] Change Date of a folder
Hi,
How can I change/set Modified date of a folder?
Please help
-
Oct 8th, 2006, 11:33 AM
#2
Re: [2003] Change Date of a folder
try this
VB Code:
Dim d As DirectoryInfo
d = New DirectoryInfo(My.Computer.FileSystem.SpecialDirectories.Desktop & "\your Folder")
d.CreationTime = Now
-
Oct 8th, 2006, 11:42 AM
#3
Thread Starter
Frenzied Member
Re: [2003] Change Date of a folder
I tried this:
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim dir1 As New DirectoryInfo("C:\Temp\Word8.0")
dir1.CreationTime = CDate("February 12, 1969")
dir1.LastAccessTime = CDate("February 12, 1969")
dir1.LastWriteTime = CDate("February 12, 1969")
Debug.WriteLine(dir1.CreationTime)
Debug.WriteLine(dir1.LastAccessTime)
Debug.WriteLine(dir1.LastWriteTime)
'The above three lines prints 2/12/1969 12:00:00 AM
End Sub
But the modified date for that particular folder is not showing in Windows explorer. Not sure why?
-
Oct 8th, 2006, 11:44 AM
#4
Thread Starter
Frenzied Member
Re: [2003] Change Date of a folder
 Originally Posted by VBDT
try this
VB Code:
Dim d As DirectoryInfo
d = New DirectoryInfo(My.Computer.FileSystem.SpecialDirectories.Desktop & "\your Folder")
d.CreationTime = Now
Thanks for your help. I want to change the modified time not create time.
-
Oct 8th, 2006, 11:50 AM
#5
Re: [2003] Change Date of a folder
I don't get it what is the problem? I can change the creation time of folders in my computer by this.
-
Oct 8th, 2006, 11:51 AM
#6
Thread Starter
Frenzied Member
Re: [2003] Change Date of a folder
 Originally Posted by cssriraman
I tried this:
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim dir1 As New DirectoryInfo("C:\Temp\Word8.0")
dir1.CreationTime = CDate("February 12, 1969")
dir1.LastAccessTime = CDate("February 12, 1969")
dir1.LastWriteTime = CDate("February 12, 1969")
Debug.WriteLine(dir1.CreationTime)
Debug.WriteLine(dir1.LastAccessTime)
Debug.WriteLine(dir1.LastWriteTime)
'The above three lines prints 2/12/1969 12:00:00 AM
End Sub
But the modified date for that particular folder is not showing in Windows explorer. Not sure why?
It works fine for date like "February 12, 2000"
The problem is solved now.
Thanks all for your help
-
Oct 8th, 2006, 11:55 AM
#7
Re: [RESOLVED] [2003] Change Date of a folder
if you don't specify the time in your date it will take the defualt value of 12:00:00 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|