title: Automated Script for photos & printing - Direction / Comments welcome
body: <p>This is what i'm hoping to achieve, i'm no expert, so am i wasting my time? </p>
  
  <ol>
  <li><p>Photo Comes in from camera - Using a wifi SD, Creates copy to folder instantly (using a .bat)</p></li>
  <li><p>Batch file runs, and checks periodically files, 
  once there are 4 files total, it moves the files to a unique
  folder, say folder 1, 2, 3 etc.</p></li>
  </ol>
  
  <p>3.Vb script then Runs the folder through Irfan, to create a 
  'Panorama' Images. </p>
  
  <p>4.Panorama Image is then Automatically Printed using .Bat file</p>
  
  <hr>
  
  <p>1.This could be Inclusive of another operation</p>
  
  <ol start="2">
  <li><p>Can this be included below?</p></li>
  <li><p>This is the script that i'm using for, this runs great however i have to manually drag folder with 3 image onto the *.vbs:</p>
  
  <pre><code>dim shell, fso
  Dim f, folderlist, item, File(4), process, panout, Irfanview, Appcall
  Dim mask, test, dot, extn, count
  set fso = CreateObject("Scripting.FileSystemObject")
  set shell = createObject("WScript.shell")
  
  'Defaults
  Irfanview = "C:\Program files\Irfanview\i_view64.exe"  'location of irfanview application
  mask = "jpg,png,gif"                                   'files to process inside folder
  panextn = ".jpg"                                       'file type for panoramas
  
  If wscript.arguments.count = 0 then
   msgbox "No folder selected" : wscript.quit
  else
   process = wscript.arguments(0)
  end if
  
  Appcall = chr(34) &amp; Irfanview &amp; chr(34) &amp; " "  
  panout= process &amp; "\panoramas"
  if fso.FolderExists(panout) = false then fso.CreateFolder(panout)
  
  Set f = fso.GetFolder(process)
  Set folderlist = f.Files
  Count=1
  For Each item in folderlist
     test= item.name : dot=InstrRev(test,".")
     if dot &gt;1 and len(test)-dot &gt;1 then extn = mid(test,dot+1) else extn = "none"
     if instr(1,mask,extn,1) &gt;0 then
        File(count) = test
        If count=3 then count=0 : pano File(1), File(2), File(3)
        count=count+1
     End If
  Next
  
  set shell=nothing
  set objFSO=nothing
  WScript.quit
  
  Sub pano (f1,f2,f3)
    concat = panout &amp; "\" &amp; head(f1) &amp; "_" &amp; head(f2) &amp; "_" &amp; head(f3) &amp; panextn
    filestring = "1," &amp; f1 &amp; "," &amp; f2 &amp; "," &amp; f3               ' horizontal=1 , vertical=2
    shell.Run Appcall &amp; "/panorama=("&amp; filestring &amp; ") /convert=" &amp; concat ,2 ,true
  ' wscript.echo concat
  End sub
  
  Function head(name)
   head=left(name, instr(name, ".")-1)
   name= process &amp; "\" &amp; name
  End function
  </code></pre></li>
  <li><p>This is a *.bat file that i'm using to print the image.. 
  Works terrific.</p>
  
  <p>@echo off</p>
  
  <pre><code>setlocal ENABLEEXTENSIONS
  
  rem ************
  rem * Settings *
  rem ************
  
  rem Path to Irfan view
  rem If IrfanView is installed in the common program files folder this part
  rem should be usable.
  rem If you have installed IrfanView elsewhere, i.e. in D:\Tools\IV then
  rem just delete these lines and uncomment and modify the set iview line.
  if /i "%PROCESSOR_ARCHITECTURE%" equ "AMD64" (
   if exist "C:\ProgramFiles\IrfanView\i_view64.exe" (
    rem Path to 64 Bit IrfanView on x64 Windows
    set iview="C:\ProgramFiles\IrfanView\i_view64.exe"
   ) else (
    rem Path to 32 Bit IrfanView on x64 Windows
    set iview="C:\ProgramFiles(x86)\IrfanView\i_view32.exe"
   )
  ) else (
   rem Path to 32 Bit IrfanView on x86 Windows
   set iview="C:\Program Files\IrfanView\i_view32.exe"
  )
  rem set iview="D:\tools\i_view32.exe"
  if not exist %iview% goto noIview
  
  rem Configure variables
  rem Delay in seconds
  set delay=10
  
  rem Directory to be scanned
  set scandir=D:\Photo
  
  rem Directory to move pictures after printing
  set printeddir=D:\Photo\Photo Printer
  
  rem File types (seperate with colon)
  set filetypes=.jpg:.jpeg
  
  rem Text file to keep file names of printed files
  set printed="%scandir%\PrintedWithIrfanView.txt"
  
  rem Use default printer
  set print=/print="HP"
  rem Or set a special printer, just replace the printer name and remove the "rem"
  rem set print=/print="My special printer"
  
  
  rem Additional tools
  set choice="%SystemRoot%\system32\choice.exe"
  if not exist %choice% goto nochoice
  set find="%SystemRoot%\system32\find.exe"
  if not exist %find% goto nofind
  
  rem Check if the directory containig the pictures exists
  if not exist "%scandir%" goto noscandir
  
  rem Check if a directory name for printed images is set and the directory exists 
  if "%printeddir%" neq "" (
   if not exist "%printeddir%" (
    mkdir "%printeddir%"
    if not exist "%printeddir%" goto noprinteddir
   )
  )
  
  rem Change to the input directory
  pushd "%scandir%"
  
  echo Scanning directory
  echo  %scandir%
  echo for new pictures and print them.
  echo.
  rem Do the loop
  :loop
  for /f "delims=" %%a in ('dir /b') do call :check "%%~fa" "%%~xa"
  
  rem Ask for exit or continue scanning
  %choice% /T %delay% /C XC /D C /M "X for exit, C for immediate checking."
  if errorlevel 2 goto loop
  
  rem After finishing go to the end
  popd
  goto end
  
  rem Check file
  :check
  echo %time% Checking...
  rem Check the file type
  echo %filetypes% | %find% /i "%~2" &gt;nul
  if errorlevel 1 goto :eof
  rem File type ok
  
  if "%printeddir%" neq "" goto check2
  
  rem If the text file does not exist, print
  if not exist %printed% call :print %1
  
  rem Check if the file name is already in the text file
  type %printed% | %find% /i %1 &gt;nul
  if errorlevel 1 call :print %1
  goto :eof
  
  rem The file have to be moved to the printed directory so there is no need for creating
  rem and checking the "printed" text file.
  :check2
  call :print %1
  move %1 "%printeddir%"
  goto :eof
  
  :print
  rem Print the picture
  echo Printing %1
  start "IrfanView" /wait %iview% %1 %print% /ini="%scandir%"
  
  if "%printeddir%" equ "" goto :eof
  rem Appending file name
  (echo %~1)&gt;&gt;%printed%
  goto :eof
  
  :noscandir
  echo %scandir% not found.
  goto end
  
  :noprinteddir
  echo %printeddir% not found and cannot be created.
  goto end
  
  rem IrfanView could not be found.
  :noiview
  echo IrfanView not found in the given path:
  echo   %iview%
  goto end
  
  rem choice could not be found.
  :nochoice
  echo choice.exe not found in the given path:
  echo   %choice%
  goto end
  
  rem find could not be found.
  :nofind
  echo find.exe not found in the given path:
  echo   %find%
  goto end
  
  rem End of the script
  :end
  endlocal
  </code></pre></li>
  </ol>