Advertisement
DeviousMalcontent

4Chan File Renaming Tool.vbs

Jun 5th, 2014
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ' Name: 4Chan File Renaming Tool
  2. ' File: 4Chan File Renaming Tool.vbs
  3. ' Licence: N/A
  4. ' Author: DeviousMalcontent
  5. ' Date: 13th June 2014
  6. ' Version: 1.0
  7. ' Release: 1
  8. ' Language: VBScript
  9. ' Compiler: N/A
  10. ' Background: I have all these maymays that I bownloaded from jokebook, 9fag, funnydump,
  11. ' le pebbit and now I'm worried if I upload them to 4chan, fags will think I have autism,
  12. ' or take me for a normal fag!
  13. '
  14. ' Or, in an alternate universe I downloaded a bunch of images from jokebook of either a girl
  15. ' I want to bone or some faggot I want to make fun of, but I'm worried it might be traced back
  16. ' to me, if they were to find the images on my hard drive.
  17. '
  18. ' So basically all this script does is rename all the image files in a directory to follow 4chans
  19. ' file naming conventions, to appear as if you downloaded them off 4chan itself, and not the original
  20. ' site.
  21. '
  22. ' Usage: Put all the images in a directory called "4Chan Files" (if you're smart you'll be able to
  23. ' figure out how to change that if you do so wish to.) then just run the script from the same directory
  24. ' as the "4Chan Files" folder.
  25. '
  26. ' >inb4 script kiddie
  27. ' Use at own risk.
  28.  
  29. Set objShell = wscript.createobject("wscript.shell")
  30. Set objFSO = CreateObject("Scripting.FileSystemObject")
  31. Set objFolder = objFSO.GetFolder(objShell.CurrentDirectory & "\4Chan Files")
  32. Set colFiles = objFolder.Files
  33.  
  34. max=9
  35. min=0
  36.  
  37. For Each objFile in colFiles
  38.     If InStr(objFile.Name, "-") <> 0 or InStr(objFile.Name, "_") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "a") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "b") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "c") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "d") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "e") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "f") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "g") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "h") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "i") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "j") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "k") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "l") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "m") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "n") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "o") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "p") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "q") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "r") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "s") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "t") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "u") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "v") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "w") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "x") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "y") <> 0 or InStr(LCase(NoExt(objFile.Name)) , "z") <> 0 Then
  39.     dim newname
  40.         newname = Int((max-min)*Rnd+min) & Int((max-min)*Rnd+min) & Int((max-min)*Rnd+min) & Int((max-min)*Rnd+min) & Int((max-min)*Rnd+min) & Int((max-min)*Rnd+min) & Int((max-min)*Rnd+min) & Int((max-min)*Rnd+min) & Int((max-min)*Rnd+min) & Int((max-min)*Rnd+min) & Int((max-min)*Rnd+min) & GetExt(objFile.Name)
  41.         objShell.Exec("cmd.exe /C rename """ & objFolder & "\" & objFile.Name & """ """ & newname & """")
  42.     End If
  43. Next
  44.  
  45. Function GetExt(fileName)
  46.     Dim pos, name, xtn
  47.     pos = InstrRev(fileName,".")
  48.     xtn = Mid(fileName,pos+1)
  49.     name = Mid(fileName,1,pos-1)
  50.     GetExt = "." & xtn
  51. End Function
  52.  
  53. Function NoExt(ByVal FileName)
  54.   Dim Result, i
  55.   Result = FileName
  56.   i = InStrRev(FileName, ".")
  57.   If ( i > 0 ) Then
  58.     Result = Mid(FileName, 1, i - 1)
  59.   End If
  60.   NoExt = Result
  61. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement