Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - watch folder and rotate and move Jpg files

Reply
 
Old 05-21-2009   #1 (permalink)
mdyod


 
 

watch folder and rotate and move Jpg files

Hey Scripting People,



I need to (1) monitor a folder (Named C1E) for new jpeg files, (2) then
rotate the new files 90 degrees and then (3) move them to another folder
(Named C2E)



I have a Batch File (SEE BELOW) that will do this using a shareware program
called IrfanView… but it is very resource tapping… it takes up 24% of my
Microprocessor! So, I am looking into Scripts.



@echo off

IF "%WD_FILE_E%" NEQ "JPG" (

IF "%WD_FILE_E%" NEQ "JPEG" GOTO :EOF

)



SET IMADIR=C:\Program Files\irfanview



"%IMADIR%\i_view32.exe" "C:\C1E\*.jpg" /jpg_rotate="(3,0,0,0,0,0,0,0)"

move "c:\C1E\*.jpg" "c:\C2E"



IF %ERRORLEVEL% NEQ 0 GOTO :EOF



I have modified the script below to successfully monitor the folder for new
files, but I don’t know the best way to rotate and move the images..


strComputer = "."

Set objWMIService = GetObject("winmgmts:" _

& "{impersonationLevel=impersonate}!\\" & _

strComputer & "\root\cimv2")

Set colMonitoredEvents = objWMIService.ExecNotificationQuery _

("SELECT * FROM __InstanceCreationEvent WITHIN 10 WHERE " _

& "Targetinstance ISA 'CIM_DirectoryContainsFile' and " _

& "TargetInstance.GroupComponent= " _

& "'Win32_Directory.Name=""c:\\\\C1E""'")

Do

Set objLatestEvent = colMonitoredEvents.NextEvent

Wscript.Echo objLatestEvent.TargetInstance.PartComponent


Loop


Questions...

1) Is it possible to write a script to change the file attributes of the
jpegs to rotate them?

2) Or must I use 3rd party software? If so, how do I call i_view32.exe"
"C:\C1E\*.jpg" /jpg_rotate="(3,0,0,0,0,0,0,0)" from a script.

3) How do I move the files from folder C1E to folder C2E after rotating?

4) Is it possible to invisibly do all of this?

5) Can I have a new pony for Christmas too?


THANKS,

Dwayne


My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Move Offline Files folder Vista General
Impossible to solve? (was Move Offline Files folder) Vista networking & sharing
move directories and files that exist in a sub folder - problem VB Script
Move Folder/Files bug Vista General
Cannot move files to public folder Vista networking & sharing


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46