Guest User

Untitled

a guest
Apr 1st, 2015
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. Option Explicit
  2. Dim Act :Set Act = CreateObject("Wscript.Shell")
  3. Dim Fso :Set Fso = CreateObject("Scripting.FileSystemObject")
  4. Dim File, NameFile, SizeFile, R1
  5. FileName()
  6.  
  7. If NameFile = "" Then
  8. R1 = MsgBox("There was no file name enter" & vbCrLf & _
  9. "Did you want to continue?" ,4132,"Error No File Name")
  10. If R1 = 6 Then FileName()
  11. If R1 = 7 Then WScript.Quit
  12. Else
  13. FileSize()
  14. If SizeFile = "" Then
  15. R1 = MsgBox("There was no file size enter" & vbCrLf & _
  16. "Did you want to continue?" ,4132,"Error No File Size")
  17. If R1 = 6 Then FileSize()
  18. If R1 = 7 Then WScript.Quit
  19. Else
  20. MakeFile()
  21. End If
  22. End If
  23.  
  24. Function FileName()
  25. NameFile = InputBox("Please type in the file name and it extension", "File Name", "", 125,125)
  26. End Function
  27.  
  28. Function FileSize()
  29. SizeFile = InputBox("Please type in the file size in bytes", "File Size", "", 125,125)
  30. End Function
  31.  
  32. Function MakeFile()
  33. Dim Ts
  34. Set Ts = Fso.CreateTextFile(Fso.GetFolder(".") & "\" & NameFile)
  35. Set File = Fso.GetFile( Fso.GetFolder(".") & "\" & NameFile)
  36. Do Until Int(File.Size) > Int(SizeFile)
  37. WScript.Echo File.Size
  38. Ts.WriteLine "ABCDEFRGHIJKLMNOPQRSTUVWXYZ1234567890"
  39. Loop
  40. Ts.Close
  41. End Function
Advertisement
Add Comment
Please, Sign In to add comment