associations for new file type

Started by fhammer, March 03, 2016, 11:35:18 AM

Previous topic - Next topic

fhammer

I've written a general-purpose .wbt utility which reads a text file, specified as a command-line parameter (accessed as param1). For example "my_utility.wbt  infile.txt". What I would like to do is this:

Name my input files with a particular (unused) extension (e.g. infile.src instead of infile.txt) and set up a file association so that, whenever I double-click an input file (with the extension .src), it will be passed to my utility.

It seems like there should be a straight-forward way to do this in Windows, but I haven't found it yet.

(I think it may be related to the fact that my_utility.wbt is not an exe file, but must in-turn be passed to the winbatch processor.)

td

Assuming you have FileMenu installed, the answer to your question is already on your system.  Look at the menu item "Associate              ;Associate this type of file with an application" in your 'FileMenu for ALL filetypes.mnw' file under the WinBatch System directory.   You can make WinBatch.exe the executable with your script being the first parameter and "%%1" the second parameter.

There are also examples in the Tech Database.  Here is a link to one:

http://techsupt.winbatch.com/webcgi/webbatch.exe?techsupt/nftechsupt.web+WinBatch/How~To+Associate~Extension~to~Run~Winbatch~File.txt
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

fhammer

Thanks for the quick response. I'm having trouble getting started with FileMenu. I've viewed the link you provided and the FileMenu section in the WinBatch User's Guide. It says FileMenu should have been installed when I installed WinBatch. However, I'm not seeing the expected context menu choices when I right-click on a file in Windows Explorer.

I do see the filemenu dll in the winbatch directory. I vaguely remember seeing some of the context menu choices in the past. I think "Clipboard Tricks" used to appear.

I have and old version of Winbatch, but prefer not to upgrade or re-install just yet. I'm probably just missing something obvious.

Thanks again for your help.

td

It all depends on what you mean by 'old' and which version of Windows you have it installed on.   If you have a 64-bit system  Windows 7 or newer and your version of WinBatch predates 64-bit WinBatch then your are mostly out of luck.  However, you don't need to use FileMenu to look at the file I mentioned.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade