WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
printing folder name (Read 2010 times)
leafster
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 1
printing folder name
Dec 9th, 2004 at 1:37am
 
What I am trying to do is monitor a folder and as a new folder is added I would like to auto print it to a specifc network printer. The folder would be a numeric number with a PDF file inside the folder. I would like to print a front page that says something like This is coming from (folder number) and then print the pdf.

Can this be done
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2224
The Netherlands
Re: printing folder name
Reply #1 - Dec 9th, 2004 at 4:52am
 
Hello,

The .bat file below should do the trick. You should let watchDirectory monitor for new files.

Code:
@echo off

rem === change the settings below ===

rem TMPDIR
rem    This script needs to create a temporary file
rem    enter the name of a directory where this file
rem    can be created (NO TRAILING BACKSLASH!!!)
SET TMPDIR=C:\Temp

rem ACROCMD
rem    the command line for printing PDF files
rem    make sure this is the same as the location on your system
rem     - enclose the path (including executable) with "quotes"
SET ACROCMD="C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe" /t


rem ACROPRT
rem   the printer to use
rem
rem this is a 3 entry value:
rem   1: printername (as can be found on "start menu -> settings -> printers & faxes")
rem   2: drivername (advanced properties of the printer)
rem   portname (see ports in properties of the printer)
rem
rem please make sure to surround entries with "quotes" if they contain spaces in their name
SET ACROPRT="HP DeskJet 950C/952C/959C" "HP DeskJet 950C/952C/959C" USB001


rem
rem Printer to use to print the banner page
rem
SET BANPRT="HP DeskJet 950C/952C/959C"

rem === no need to change anything below ===

rem we only process new files
IF "%WD_REASON%" NEQ "FILENEW" GOTO :Done

rem check for valid file type
IF NOT "%WD_FILE_E%" == "PDF" GOTO :Done

rem
rem create the banner page
rem

SET BAN=%TMPDIR%\%WD_TIME%.TXT
ECHO %WD_DATE% %WD_TIME% %WD_FILE_N% > "%BAN%"
ECHO Found in directory %WD_FILE_D% >> "%BAN%"

notepad /pt "%BAN%" %BANPRT%
DEL "%BAN%"

rem
rem print the pdf
rem

"%WD_INSTDIR%\GdPUtil.exe" -runkill 120 %ACROCMD% "%WD_FILE%" %ACROPRT%
goto :Done


:Done
 



Gert

Edited:
small typo:
ECHO Found in directory %WD_FILE_D% > "%BAN%"
should have been
ECHO Found in directory %WD_FILE_D% >> "%BAN%"
Back to top
« Last Edit: Dec 9th, 2004 at 5:02pm by Gert »  

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
Page Index Toggle Pages: 1