GNTL Homepage
Forum Home Forum Home > General Information Technology > Programming and Scripting
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

Create a bunch of random TMP Files

 Post Reply Post Reply
Author
Message
BK View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23-February-2005
Location: United Kingdom
Online Status: Offline
Posts: 26
Post Options Post Options   Quote BK Quote  Post ReplyReply Direct Link To This Post Topic: Create a bunch of random TMP Files
    Posted: 17-January-2008 at 10:58
' This script creates a whole load of TMP files in a directory.  The directory and the number of file to create, is achieved via a prompt.
 
Set oFSO = CreateObject("Scripting.FileSystemObject")
sPath = InputBox("Enter the Path to where the Temp Files should be created, i.e. C:\Temp:", "Temp File Location", "C:\Temp")
If sPath = "" Then
 MSGBOX "InValid Path"
 MSGBOX "Exiting Script..."
 WScript.Quit
 Else
 For i = 1 to InputBox("Enter the Number of Temp Files to Create:", "Number of Temp Files", "1")
  sFileName = oFSO.GetTempName
  sFullName = oFSO.BuildPath(sPath, sFileName)
  Set oFile = oFSO.CreateTextFile(sFullName)
  oFile.Close
 Next
MSGBOX i-1 & " File(s) created in: " & sPath
       
End If
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.66 [Free Express Edition]
Copyright ©2001-2010 Web Wiz

This page was generated in 0.047 seconds.