• Welcome to OS2World OLD-STATIC-BACKUP Forum.
 

News:

This is an old OS2World backup forum for reference only. IT IS READ ONLY!!!

If you need help with OS/2 - eComStation visit http://www.os2world.com/forum

Main Menu

Is there a command which opens app associated with data file?

Started by cytan, 2008.09.04, 23:42:00

Previous topic - Next topic

cytan

HI,
   I'm wondering whether there is a cmd line app (or a command) which will automatically open the correct app associated with the data file? E.g. if I have a pdf file called a.pdf, I can type on the command line:

   [C:\OS2] open a.pdf

(where open is some cmd line app or command) and Lucide is automatically called to open a.pdf? I'm assuming that the EA's have been correctly set for a.pdf.

Thanks for any info!

cytan

Ben

Quote from: cytan on 2008.09.04, 23:42:00
HI,
   I'm wondering whether there is a cmd line app (or a command) which will automatically open the correct app associated with the data file? E.g. if I have a pdf file called a.pdf, I can type on the command line:

   [C:\OS2] open a.pdf

(where open is some cmd line app or command) and Lucide is automatically called to open a.pdf? I'm assuming that the EA's have been correctly set for a.pdf.

Thanks for any info!

cytan


This ought to do the trick for you.

Just put it into a directory that's in your config.sys path statement.

Then open a commandline and type "open" followed by whatever it is that you want opened, be it a directory, or a file. It will use the default application for that file type.

cytan

Hi Ben,
   I just downloaded it and ran it on the command line. It brought up the app but did not actually load it into the app. Maybe I'm doing something wrong ... I did the following:

[D:\tmp].\open cv.pdf
Opening DEFAULT view for object "D:\tmp\cv.pdf".

And Lucide popped up but cv.pdf was not loaded.

Any pointers?

cytan


Quote from: Ben on 2008.09.05, 00:50:58
Quote from: cytan on 2008.09.04, 23:42:00
HI,
   I'm wondering whether there is a cmd line app (or a command) which will automatically open the correct app associated with the data file? E.g. if I have a pdf file called a.pdf, I can type on the command line:

   [C:\OS2] open a.pdf

(where open is some cmd line app or command) and Lucide is automatically called to open a.pdf? I'm assuming that the EA's have been correctly set for a.pdf.

Thanks for any info!

cytan


This ought to do the trick for you.

Just put it into a directory that's in your config.sys path statement.

Then open a commandline and type "open" followed by whatever it is that you want opened, be it a directory, or a file. It will use the default application for that file type.


cytan

Hmmm, something seems to be screwed up ... I double clicked on the icon for a pdf file and Lucide popped up but also did not have the file displayed. Same with a gif file, pmview popped up but no picture. Hmmm ....

I'd rather not reboot right now. Is the WPS confused?

cytan

Ben

Hmm.

You seem to have other problems.

The open.cmd file does nothing in and of itself other than call the program that is associated with the file. It doesn't touch the INI files or make any changes to anything. I've used it for years without a problem.

Do you have anything else there by a similar name? For example "open.exe", that got ran inadvertently?

Just to make sure it did what you want I ran "

cytan

I think there may be other problems, may be WPS related. I made sure that it was open.cmd that I called. Weird part is that double clicking on the data file (with the icon related to the app, e.g. Lucide) brings up the app, but it does not display the data. Hmmmm.... a reboot may be in order, but I loathe to do it right now since the box has been up for 10 days now and I'd like to see how long it can go ...

cytan

Ben

Hmm..

It seems to me that it has reached its limit.  ;)

Though 10 days seems a bit short for OS/2.


cytan

Hi Ben,

This is really interesting. open.cmd works for some data files but not others. txt and openoffice files call up the correct app and displays them correctly. But pdf's  and gifs do not with Lucide or pmview. Double clicking on a pdf file also brings up Lucide but does not display the file (and similarly pmview)


Do you have the same problem?

cytan 

Ben

I have never seen that behavior.

I'm wondering if you have INI problems. There are tools out there to deal with this.

Make sure that it doesn't have something to do with spaces in the name, or too many dots.

Also, "Association Editor" might help you.


Glenn

I prefer the open.exe contained in the FM2 utilities:

ftp://ftp.netlabs.org/pub/fm2/fm2utils.zip

There are some other nice jewels in there too.

Ben

Quote from: Glenn on 2008.09.10, 16:17:52
I prefer the open.exe contained in the FM2 utilities:

ftp://ftp.netlabs.org/pub/fm2/fm2utils.zip

There are some other nice jewels in there too.

Ah, yes...

The 'Fm-ly Jewels'... it's always a pleasure to utilize them... /2

:D

P.S. Pardon my play...

abwillis

The open.cmd here opens directories fine for me (already had a small script that did just that) but is is not opending PDF files.  Conversely, open.exe is opening the PDF files as well as directories.
Same holds true for doc files, ppt files, txt files, and just tried a HTM file with the same results.
Andy
I am using Object REXX in case that makes a difference.

cytan

Quote from: abwillis on 2008.09.10, 18:19:47
The open.cmd here opens directories fine for me (already had a small script that did just that) but is is not opending PDF files.  Conversely, open.exe is opening the PDF files as well as directories.
Same holds true for doc files, ppt files, txt files, and just tried a HTM file with the same results.
Andy
I am using Object REXX in case that makes a difference.

Does double clicking on the pdf file open it correctly?

I used assoedit to re-edit my associations by pointing to Lucide directly, i.e. d:/Lucide/Lucide.exe
rather than using the object Lucide and now it works when I use open.cmd or open.exe

I think something is screwed up with my ini files. However, I still haven't been able to do that with
jpeg files with pmview.

I'll keep you guys posted.

cytan

ddan

cytan: There is now a command line app as I think you wish for, or will be
shortly, soon as the Hobbes guy okays it, I guess.

It's yet another variation on my file selector / browser which is general
purpose, editable for associations (by manual editing of the REXX code) to
launch a program depending on file extension. Only a BETA but useful, such as
a front-end for TEDIT.EXE when looking for documentation. Been debating on it
for some time; your post nudged me a bit.

Look for GFSBETA.ZIP at:
http://hobbes2.nmsu.edu/h-browse.php?dir=/pub/incoming&sort=date

If you have the latest MPlayer, which I've found preferable to all previous,
can add it and its types, however, it's a big advantage to have the files
filtered to videos as in a previous selector for K Movie Player:
http://hobbes2.nmsu.edu/download/pub/os2/apps/mmedia/video/players/kmpfs10.zip

This is my current list of known file types for MPlayer:
'*.avi *.wmv *.mpg *.mpeg *.mov *.flv *.rm *.rmvb *.m4v *.asf *.mp4'
May be yet others; I've yet to find documentation. Test by switching filter
off (uppercase 'F'), so that all file types are shown, then <enter> on the
suspected type.

Incidentally, to anyone looking deep into the REXX code, believe I've fixed a
longstanding bug when starting on an empty directory. Previous versions don't
need to be modified because was worked around, but should now be a bit less
finicky for general use.

abwillis

Quote from: cytan on 2008.09.10, 18:51:09
Quote from: abwillis on 2008.09.10, 18:19:47
The open.cmd here opens directories fine for me (already had a small script that did just that) but is is not opending PDF files.  Conversely, open.exe is opening the PDF files as well as directories.
Same holds true for doc files, ppt files, txt files, and just tried a HTM file with the same results.
Andy
I am using Object REXX in case that makes a difference.

Does double clicking on the pdf file open it correctly?

I used assoedit to re-edit my associations by pointing to Lucide directly, i.e. d:/Lucide/Lucide.exe
rather than using the object Lucide and now it works when I use open.cmd or open.exe

I think something is screwed up with my ini files. However, I still haven't been able to do that with
jpeg files with pmview.

I'll keep you guys posted.

cytan

Yes, double clicking opens them fine... the open.exe working shows the association is correct as well.
I'll look at the Rexx Code at some point.