Link to home
Start Free TrialLog in
Avatar of Jason Kidman
Jason KidmanFlag for United States of America

asked on

.ZPL files to open with .BAT file

I am unable to change .zpl files to open with a .bat file that was created for printing.  I go to "open with" and add the check mark to always open with .... and it prints and works great but we have to do that every time.  it is windows 10 we are using and I cant figure out how to make all .zpl files when clicked on to auto open the label.bat file.  any ideas how to force that to happen as it is not saving label.bat as the program to open all .zpl files with.
Avatar of BobPrinceExpert
BobPrinceExpert
Flag of United States of America image

Did you set it to pass the filename as a parameter.
Maybe look at this:
https://superuser.com/questions/913705/how-to-pass-parameters-in-batch-file-and-zip-the-file-using-7z-exe

The batch file needs to know the name of the file.
Bob
Avatar of hdhondt
I have trouble understanding your question.
open with .BAT file
What do you mean by that? What does the BAT file need to do with the ZPL file? If the BAT file is just used to print the file, make sure that the line that does the actual printing includes a %1 parameter for the file name.

For anything else, please post the contents of your BAT file so we can see what you're trying to do.
Avatar of Jason Kidman

ASKER

This is what is in the .bat file

Net use LPT2: \\%ComputerName%\DevinsLabelPrinter
Copy %1 LPT2
Net use LPT2: /Delete

so if we open the .zpl with this .bat file it prints and works great
but every time we need to click "open with" as it is not saving the open with option to always open .zpl files with this .bat file.
the goal is when we click on the .zpl file it automatically opens the above .bat file ..currently .zpl is not associated with any program and adding the check to always open with lable.bat does nothing as it's not saving the file association.
I think this is a windows 10 issue as windows 7 seems to keep the association
ASKER CERTIFIED SOLUTION
Avatar of hdhondt
hdhondt
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial