Bat file to automate printing task in folder

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
randomasian
Posts: 10
Joined: 29 Sep 2014 23:56

Bat file to automate printing task in folder

#1 Post by randomasian » 30 Sep 2014 00:02

Is there any kind souls out there willing to help me write a bat file to , go to certain directory to the folder , then open the first file ( it’s a dwg/solidworks file) using any kind of program , print to pdf , then close the file , and repeat the same action for the rest of the file in the folder .

I can only say I will thank you from the bottom of my heart as my knowledge on bat files is very very limited . Payment is negotiable .
However if its free then that would be the best
:D :D :D

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Bat file to automate printing task in folder

#2 Post by foxidrive » 30 Sep 2014 01:43

Pick a PDF creation program that has command line abilty and tell us the folder path, if it's on a network, and where you want the files etc.

randomasian
Posts: 10
Joined: 29 Sep 2014 23:56

Re: Bat file to automate printing task in folder

#3 Post by randomasian » 30 Sep 2014 02:43

I'm using Bullzip PDF Printer . I was told it has the command line ability but I have no idea how to use them . The folder path for the files are in C:\To Be Uploaded\Print , the output folder is a network shared drive Z:\aa , but I have no preference, a new folder on desktop is ok for me also . if I understand the script maybe I can change it myself later . Thank you :D

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Bat file to automate printing task in folder

#4 Post by foxidrive » 30 Sep 2014 03:10

randomasian wrote:I'm using Bullzip PDF Printer


I have browsed the web page but can't find any command line information - do you have the command line list of switches there?

randomasian
Posts: 10
Joined: 29 Sep 2014 23:56

Re: Bat file to automate printing task in folder

#5 Post by randomasian » 30 Sep 2014 03:21

I was told this is the link . http://www.bullzip.com/products/pdf/doc/info.php .
Or can I email the folder to u ? The API file is in the folder .

randomasian
Posts: 10
Joined: 29 Sep 2014 23:56

Re: Bat file to automate printing task in folder

#6 Post by randomasian » 30 Sep 2014 03:31

https://www.dropbox.com/s/cmx412tgyukgw ... r.zip?dl=0

Inside the link is the entire zipped folder . Most probably in the API folder . Is this it ?

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Bat file to automate printing task in folder

#7 Post by foxidrive » 30 Sep 2014 03:56

http://www.biopdf.com/guide/exe_interface.php

This link above shows bugger all, except that the command line doesn't control the PDF software in operation - it just allows you to change the config file and
presumably you need to rewrite the config file for each operation.

A different program would be more useful - one that lets you execute the program with an input file, and output filename and the switches to control the task.
I don't use PDF software so I can't recommend one myself.

randomasian
Posts: 10
Joined: 29 Sep 2014 23:56

Re: Bat file to automate printing task in folder

#8 Post by randomasian » 30 Sep 2014 04:14

The zipped folder does not contain enough info also? I will look for a new pdf converter and reply here and if you are still free please help me to take a look at it . Thank you for the reply man.


randomasian
Posts: 10
Joined: 29 Sep 2014 23:56

Re: Bat file to automate printing task in folder

#10 Post by randomasian » 30 Sep 2014 17:53

VeryPDF actually has a mass converter function but the results are not as expected . But anyway is it possible to write a bat file with this ?

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Bat file to automate printing task in folder

#11 Post by Squashman » 30 Sep 2014 19:06

Untested and assuming that VeryPDF adds its install directory to the PATH environmental variable.

Code: Select all

@echo off
FOR %%G in ("C:\To Be Uploaded\Print\*.dwg") DO dwg2pdf -i "%%~G" -o "Z:\aa\%%~nG.pdf"

randomasian
Posts: 10
Joined: 29 Sep 2014 23:56

Re: Bat file to automate printing task in folder

#12 Post by randomasian » 30 Sep 2014 19:28

Hmm, is sending keystrokes an option ? as in Ctrl+P after opening the file ?

sorry if my questions are stupid .____.

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Bat file to automate printing task in folder

#13 Post by Squashman » 30 Sep 2014 20:02

Sending keystrokes in batch files is NOT an option.
As far as I can tell from the command line documentation for VeryPDF, it should not prompt you to press any key. It should just do the conversion and be done.

randomasian
Posts: 10
Joined: 29 Sep 2014 23:56

Re: Bat file to automate printing task in folder

#14 Post by randomasian » 30 Sep 2014 20:41

Alright . I'll give it a try . Thanks !

Squashman
Expert
Posts: 4488
Joined: 23 Dec 2011 13:59

Re: Bat file to automate printing task in folder

#15 Post by Squashman » 30 Sep 2014 20:44

May I ask what software you are using right now to view or edit the DWG files? You sure it doesn't have a command line interface already for exporting to PDF?

Post Reply