daily pastebin goal
29%
SHARE
TWEET

imageResizer.vbs

iampiergiu Dec 23rd, 2011 437 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. '--------------------------------------------------------------------
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top