Execute Btbat File With Vbscript 追蹤

0
Avatar
Legacy Poster

Hi,

 

I have a problem to print product labels for each production automatically on the moment an procution order is send to the printer.

 

The goal that I want to achieve:

 

1 - When a production order will be printed in our ERP system create an btbat (extension for Batch Maker) file
2 - Save this btbat file on the hard disk
3 - Execute this btbat file

4 - Batch Maker will print a BarTender labels for the printed production order

5 - Delete btbat file after printing

 

I have managed to create step 1 and 2.

For each new job (production order) a btbat file will be created in the folder :

"c:/Batch Maker/btbat files" :
- "ID-1.btbat"
- "ID-2.btbat"

- "ID-3.btbat"

 

A btbat file contains the following information:

<?xml version="1.0"?>
<XMLScript Version="2.0">

 <Command>
  <Print>
   <Format CloseAtEndOfJon="true" SaveAtEndOfJob="false">*Location of label*</Format>
   <QueryPrompt Name="ItemCode"><Value>*ItemCode*</Value></QueryPrompt>
   <QueryPrompt Name="NumberOfLabels"><Value>10</Value></QueryPrompt>
   <PrintSetup>
    <EnablePrompting>false</EnablePrompting>
   <UseDatabase>true</UseDatabase>
   </PrintSetup>

  </Print>
 </Command>

</XMLScript>

 

Now I have to click manually on a btfile to print it and this is working fine but I prefer to do this automatically :).

 

My question:

- Is it possible to create an vbscript to execute this btfile file? I can excute this file after I have saved this on the hard disk.
- Or is there an easier way to achieve my goal?

I hope you guys could help me with this topic.

 

Thank you in advance.

Kind Regards,
Rick

登入寫評論。