Windows Environment Variables With Commander?
Does anybody happen to have an example of using environment variables with Commander scripts? I have a system creating data files, which contain hard-coded specifications of which label template to use and a hard-coded printer name. For ease of use, my preference is to have the system that exports the data files use more generic names for both of these, so that only the Bartender server system happens to know or care about the exact name of the label templates or the printers. I think I can handle both with windows environment variables...?
Is there a better practice than this approach for what I'm trying to do, as I build to dozens of printers and label templates?
Thanks :)
EDIT: Seems like Commander won't work with WEVs. I have %TESTTEMPLATE% as an entry and when I navigate to that in windows explorer it pulls up the template, but when I put it into an otherwise-functioning commander script nothing happens; in the Commander log I see the AF=%TESTTEMPLATE% , but never get a print. When I change back to the hard-coded, which %TESTTEMPLATE% points to, it works.
-
The use of Commander/Enviromental variables is with the percent sign syntax. For example, the most commonly used is something like /D="%Trigger File Name%" to set the data file name of the print job to be equal to the file that Commander just detected and renamed. Does that help you?
0 -
The use of Commander/Enviromental variables is with the percent sign syntax. For example, the most commonly used is something like /D="%Trigger File Name%" to set the data file name of the print job to be equal to the file that Commander just detected and renamed. Does that help you?
Thanks, Ian, but I still cannot get it to work. In windows 2008, Commander 10.1 I have a user variable defined under environment variables called TESTTEMPLATE, which points to c:\commander\label.btw. When I navigate in windows file explorer to %TESTTEMPLATE%, it loads that file up properly.
To confirm proper printing of a hard-coded BTW, I have a file with this at its beginning, WEV_1 (see attachment). That works well.
I then copied/pasted that file, and renamed it slightly and confirmed the renamed file worked. I then changed only the file lable location to call %TESTTEMPLATE%, and tried again, but now nothing prints (WEV_2 attachment), this whether I enclose the %TESTTEMPLATE% in double quotes or not. To confirm that file was otherwise still good, I also finally changed %TESTTEMPLATE% again back to the hard-coded location, saved, and tried the file again and it ran.
So basically I have confirmed that %TESTTEMPLATE% is a proper environment variable, but when commander runs, it just doesn't seem to translate it.
Thanks!
0 -
Is that a user or system based ENV variable? If user then you'd need to make sure that the Commander application/service is also running under that same account. Any reason why you don't just setup a custom Commander varaible? Do this via the, "File>Task List Options" menu item, select the "Variables" tab, and specify your name/value variable pairs.
0 -
Is that a user or system based ENV variable? If user then you'd need to make sure that the Commander application/service is also running under that same account. Any reason why you don't just setup a custom Commander varaible? Do this via the, "File>Task List Options" menu item, select the "Variables" tab, and specify your name/value variable pairs.
Hi Ian, it was a user based variable and Commander running under application mode as the current user, but your comment gave me some ideas of where else to look.
However, task list variables are going to work perfectly--I had not used this before, and they fit the bill precisely. Just tested and working in my test. Kinda scary I never noticed them before :o
Thanks for your help! I'm good to go now.
0
请先登录再写评论。
评论
4 条评论