Thread: Create Folder
View Single Post
  #2 (permalink)  
Old October 11th, 2006, 02:40 PM
jezywrap jezywrap is offline
Authorized User
 
Join Date: Dec 2005
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Never mind I got it. Here is the code if anyone is interested.

Dim Result1, Result2, x
Dim objFSO

Set objFSO = CreateObject("Scripting.FileSystemObject")

Result1 = InputBox("Enter Begining Folder Number : ")

If Result1 = "" Then
   Wscript.Echo "No input was given"
   Result1 = InputBox("Enter Begining Folder Number : ")
End If

x = Result1

Result2 = InputBox("Enter Ending Folder Number : ")

If Result2 = "" Then
   Wscript.Echo "No input was given"
   Result2 = InputBox("Enter Ending Folder Number : ")
End If

If Result1 > Result2 Then
   MsgBox "First number can't be greater than second number"
   Wscript.Quit()
Else
   For x = x to Result2 Step 1
    If objFSO.FolderExists("C:\YourStuff\" & "000" & x) Then
       Msgbox "Folder " & "000" & x & " already exists"
    else
       Set objFolder = objFSO.CreateFolder("C:\YourStuff\" & "000" & x)
       MsgBox "This folder was created " & "000" & x
    End If
   Next

End If

WScript.Quit()


Reply With Quote