• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

need to run command line on variable file...

ZippyDan

Platinum Member
i didn't know exactly how to title this.

in windows vista business. i'm dealing with a legacy inventory system that is currently running on a centos server which has a dot matrix printer attached from where print all the invoices and stuff.

i need to print certain text files to the dot matrix printer (via samba and cups) by using the command line PRINT command. (printing from notepad using windows printing result in completely screwed up formatting).

i have already successfully done this from the command line (print /d: \xxx.xxx.xxx.xxx\printername c: \directory\longpath\filename)

the problem is that the users that need to be using this ability, do not have the technical chops (nor frankly the time) to be typing out this command for each file. the file name is variable and unpredictable (new files are being created all the time), so this is not something i can solve with a simple batch file.

they are able to navigate windows explorer fairly well, so what i would like to be able to do is somehow allow them to right-click on a particular file, have a customized Print to DotMatrix option there, which would then execute the PRINT command on that path\filename. anyone know how i might accomplish this?
 
Last edited:
All you'd have to do is make sure the cmd file uses "%1" as the filename and then call the script as "blah.cmd filename".

Adding right-click options manually in the registry isn't terribly difficult, but it's been years since I've done something like that.
 
All you'd have to do is make sure the cmd file uses "%1" as the filename and then call the script as "blah.cmd filename".

Adding right-click options manually in the registry isn't terribly difficult, but it's been years since I've done something like that.

That's half way there, but I still have two separate things here: the blah.cmd and the filename. My users are GUI people. They can double click on blah.cmd. They can right-click on file name. But I can't rely on them to use the command line and do "blah.cmd filename" (especially when filename might be a fairly long path).

It suddenly occurs to me to wonder what happens if you drag a file onto blah.cmd. Does it execute as" blah.cmd filename"?
 
Yes, the drag and drop thing should work. As should adding your own right-click menu entry via the registry.
 
Back
Top