Option Explicit
On Error Resume Next
Dim MyStrIP, MyStr0, MyStrDir, MyTM0, MyTM1
Dim MyCnt, MyInc0, MyInc1
Dim MyFSO, MyDRV, MyTXT
Dim MyFreeSpace
Dim MyChk
MyCnt = 1
MyStrIP = InputBox("100MBの巨大無駄ファイル、いくつ作る?")
If MyStrIP = "" Then
WScript.Quit
End If
If IsNumeric(MyStrIP) = False Then
MsgBox "数字を入れろ", vbOKOnly, "何やってんだバカ"
WScript.Quit
End If
MyCnt = Int(MyStrIP)
MyTM0 = Time
Set MyFSO = CreateObject("Scripting.FileSystemObject")
Set MyDRV = MyFSO.GetDrive("C:")
MyFreeSpace = Int(MyDRV.FreeSpace / 1048576)
Set MyDRV = Nothing
If 100 * MyCnt > MyFreeSpace - 500 Then
Set MyFSO = Nothing
MsgBox "100MBX" & MyCnt & "個なんて無茶だ、やめろ", vbOKOnly, "ハードディスクの残" & MyFreeSpace & "MB"
WScript.Quit
End If
MyChk = False
MyStrDir = CreateObject("WScript.Shell").CurrentDirectory & "\muda"
For MyInc0 = 0 To 999
If MyFSO.FolderExists(MyStrDir + Right("00" & MyInc0, 3)) = False Then
MyStrDir = MyStrDir + Right("00" & MyInc0, 3)
MyFSO.CreateFolder (MyStrDir)
MyChk = True
Exit For
End If
Next
If MyChk = False Then
MsgBox "とりあえず作りすぎた無駄フォルダ削除してくれ", vbOKOnly, "どうでもいいけど"
WScript.Quit
End If
MyStr0 = ""
For MyInc0 = 1 To 5120
MyStr0 = MyStr0 & "0000000000"