Advertisement
iampiergiu

imageResizer.vbs

Dec 23rd, 2011
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. ' Nioi Pier Giuliano
  2.  
  3. ' http://piergiu.wordpress.com/
  4.  
  5. ' purpose of this script:
  6. ' resizes images with irfanview and saves them in the script folder
  7.  
  8.  
  9.  
  10. '----------------------DO NOT modify this----------------------------
  11. set objShell = wscript.createObject("wscript.shell")
  12. set objFSO = CreateObject("Scripting.FileSystemObject")
  13.  
  14. DIM pt1,pt2,pt3,all,width,height,installationPath
  15. '--------------------------------------------------------------------
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23. '-----------------PLEASE DO modify this at your needs----------------
  24. width = 800
  25. height = 600
  26. installationPath = "C:\Program Files\IrfanView\"
  27. '--------------------------------------------------------------------
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. '----------------------DO NOT modify this----------------------------
  36. pt1 = "CMD /C " & """" & installationPath & "i_view32.exe" & """"
  37. pt2 = " /resize=(" & width & "," & height & ") /convert="
  38.  
  39. '----------- USE the following pt2 instead of the previous pt2 to keep aspect ratio of the image ------------
  40. '-- pt2 = " /resample=(" & width & "," & height & ") /aspectratio /convert="
  41.  
  42.  
  43. scriptFolder = objFSO.GetParentFolderName(Wscript.ScriptFullName)
  44.  
  45. For Each a In WScript.Arguments
  46.  
  47. set objFile = objFSO.GetFile(a)
  48. pt3= scriptFolder & "\" & objFSO.GetBaseName(objFile) & "_rid." & objFSO.GetExtensionName(objFile)
  49. all= pt1 & " " & a & pt2 & pt3
  50. iReturn = objShell.Run(all, , True)
  51. 'WScript.Echo all
  52.  
  53. Next
  54. '--------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement