Manufacturing Information Solutions Forum Index Manufacturing Information Solutions
Your Place for Support and Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

VB Script for making test files

 
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> VB Script
View previous topic :: View next topic  
Author Message
mistux
Site Admin


Joined: 25 Jun 2004
Posts: 1042
Location: South Bend, Indiana USA

PostPosted: Mon Jun 19, 2006 9:39 am    Post subject: VB Script for making test files Reply with quote

This VBScript will crate as many test files as you want.
Code:

' ======================================================
' Purpose:  This will make as many files as you want, in
'           the directory you want.
' Usage:    intHowManyFiles is how many files you want created.
'           intStart is the number you want to start at.
'           You can also specify the path and the string
'           that gets inserted into the file.
' Author:   Michael J. Mitchell
'========================================================

DIM intStart, intx
DIM fso, NewsFile
DIM intHowManyFiles

'==================
intHowManyFiles=1
intStart= 0
'=================


DO
     intStart = intStart+ 1
     intx = intStart+ intStart
     Set fso = CreateObject("Scripting.FileSystemObject")

'=====================================================

'====Change the path here=======
     Set NewsFile = fso.CreateTextFile("c:\predator_test\" & intStart& ".txt", True)

'====Change the text in the file here=======
     NewsFile.WriteLine("Test" & intStart)

'=====================================================

     NewsFile.Close
Loop Until intStart= intHowManyFiles

msgbox "Finished making " & intHowManyFiles & " Files"


I have made about 70,000 files in about 10 minutes using this.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Manufacturing Information Solutions Forum Index -> VB Script All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group