PDA

View Full Version : I need to create several random files



iMrTidy
04-29-2012, 08:57 AM
Creation date of these files should be different by milliseconds. I have tried to put a delay between the file's creation but it either does not work (the same milliseconds) or it rounds up to a second. The code I tried:
For y = 1 To intNFiles
Set objFSO = New FileSystemObject
Set objFSOFile = objFSO.CreateTextFile(strSourceFolder & "Test" & y & ".txt", False)
Sleep 95&
Set objFSO = Nothing
Set objFSOFile = Nothing
Next
As an option it should be possible to reset creation date with API SetFileTime but that is the last option I would use. Any ideas how to fix it?