Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Dim Act :Set Act = CreateObject("Wscript.Shell")
- Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")
- Dim File, NameFile, SizeFile, R1
- FileName()
- If NameFile = "" Then
- R1 = MsgBox("There was no file name enter" & vbCrLf & _
- "Did you want to continue?" ,4132,"Error No File Name")
- If R1 = 6 Then FileName()
- If R1 = 7 Then WScript.Quit
- Else
- FileSize()
- If SizeFile = "" Then
- R1 = MsgBox("There was no file size enter" & vbCrLf & _
- "Did you want to continue?" ,4132,"Error No File Size")
- If R1 = 6 Then FileSize()
- If R1 = 7 Then WScript.Quit
- Else
- MakeFile()
- End If
- End If
- Function FileName()
- NameFile = InputBox("Please type in the file name and it extension", "File Name", "", 125,125)
- End Function
- Function FileSize()
- SizeFile = InputBox("Please type in the file size in bytes", "File Size", "", 125,125)
- End Function
- Function MakeFile()
- Dim Ts
- Set Ts = Fso.CreateTextFile(Fso.GetFolder(".") & "\" & NameFile)
- Set File = Fso.GetFile( Fso.GetFolder(".") & "\" & NameFile)
- Do Until Int(File.Size) > Int(SizeFile)
- WScript.Echo File.Size
- Ts.WriteLine "ABCDEFRGHIJKLMNOPQRSTUVWXYZ1234567890"
- Loop
- Ts.Close
- End Function
Advertisement
Add Comment
Please, Sign In to add comment