Option Explicit Dim objFSO, objShell, objTextFile, objFile Dim strDirectory, strFile, strText, strShardDirectory strDirectory = "c:\projects\svn-shards\shards\" strText = "a" Dim blnSharding blnSharding = True ' change this boolean to enable creation of sharding subdirectories ' Create the File System Object Set objFSO = CreateObject("Scripting.FileSystemObject") ' Check that the strDirectory folder exists If objFSO.FolderExists(strDirectory) Then objFSO.GetFolder(strDirectory) Else objFSO.CreateFolder(strDirectory) WScript.Echo "Created " & strDirectory End If Dim i, intFiles intFiles = 2^20 Dim StartTime, EndTime, EachTime, OpenTime StartTime = Timer For i = 1 To intFiles If blnSharding Then strShardDirectory = i \ 1000 & "\" End If strFile = strDirectory & strShardDirectory & i & ".txt" ' Create the file if it doesn't exist If NOT objFSO.FileExists(strFile) Then ' Create the directory if it doesn't exist If NOT objFSO.FolderExists(strDirectory & strShardDirectory) Then objFSO.CreateFolder(strDirectory & strShardDirectory) End If 'WScript.Echo "Creating " & strFile Set objFile = objFSO.CreateTextFile(strFile) End If ' Test time-to-open If i mod 1000 = 0 Then OpenTime = Timer Set objTextFile = objFSO.OpenTextFile (strFile, 1, True) ' open for reading WScript.Echo "Open of " & strFile & " took " & Timer - OpenTime & " sec." Set objTextFile = nothing End If set objFile = nothing Next EndTime = Timer - StartTime EachTime = EndTime / (i-1) WScript.Echo "Created " & (i-1) & " files in " & EndTime & " seconds. Avg time each = " & EachTime WScript.Quit